From d1cbea949bf338528a6da4d047ecf62bfabe42bc Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Sun, 7 Dec 2008 21:09:23 +0100 Subject: Fixed eDBmkMapping_USERINFO(...) to let the uid_str be NULL if uid == 0 --- database/eurephiadb_common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'database') diff --git a/database/eurephiadb_common.c b/database/eurephiadb_common.c index ca5831d..fef9d15 100644 --- a/database/eurephiadb_common.c +++ b/database/eurephiadb_common.c @@ -72,8 +72,12 @@ eDBfieldMap *eDBmkMapping_USERINFO(eurephiaCTX *ctx, eDBfieldMap *dbmap, eurephi assert( map != NULL ); // Convert uid from int to char * - uid_str = (char *) malloc(33); - snprintf(uid_str, 32, "%i%c", user->uid, 0); + if( user->uid != 0 ) { + uid_str = (char *) malloc(33); + snprintf(uid_str, 32, "%i%c", user->uid, 0); + } else { + uid_str = NULL; + } for( ptr = map; ptr != NULL; ptr = ptr->next ) { // Copy over field name - translated via the db mapping table -- cgit