diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-07 21:09:23 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-07 21:09:23 +0100 |
| commit | d1cbea949bf338528a6da4d047ecf62bfabe42bc (patch) | |
| tree | 2eb3f1251c1438a4f18744cdb52cce8c19eecc40 /database | |
| parent | 2d9f3b0687431e8b75ee37641e25987edf3f6cdc (diff) | |
| download | eurephia-d1cbea949bf338528a6da4d047ecf62bfabe42bc.tar.gz eurephia-d1cbea949bf338528a6da4d047ecf62bfabe42bc.tar.xz eurephia-d1cbea949bf338528a6da4d047ecf62bfabe42bc.zip | |
Fixed eDBmkMapping_USERINFO(...) to let the uid_str be NULL if uid == 0
Diffstat (limited to 'database')
| -rw-r--r-- | database/eurephiadb_common.c | 8 |
1 files changed, 6 insertions, 2 deletions
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 |
