From: matze Date: Fri, 26 Oct 2007 01:45:37 +0000 (+0000) Subject: defined NICKNAME_MAX_LEN X-Git-Tag: rgb2rv6~44 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8c03a278003a103edfc5d48f52a3ebeea687d0be;p=c128-kasse defined NICKNAME_MAX_LEN git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@65 af93e077-1a23-4f1e-9cbe-9382a9d578f5 --- diff --git a/include/config.h b/include/config.h index 5393a56..02513a4 100644 --- a/include/config.h +++ b/include/config.h @@ -27,8 +27,9 @@ struct status_array_t { }; /* Datenstruktur für die Guthaben */ +#define NICKNAME_MAX_LEN 10 struct credits_t { - char nickname[11]; + char nickname[NICKNAME_MAX_LEN + 1]; /* Guthaben (in Cent) */ unsigned int credit; }; diff --git a/src/credit_manager.c b/src/credit_manager.c index c6e5616..8198d7e 100644 --- a/src/credit_manager.c +++ b/src/credit_manager.c @@ -44,7 +44,7 @@ static void credit_print_screen() { struct credits_t *find_credit(char *name){ int i; for (i = 0; i < credits.num_items; i++) - if (strncmp(name, credits.credits[i].nickname, 11) == 0) + if (strncmp(name, credits.credits[i].nickname, NICKNAME_MAX_LEN + 1) == 0) return &credits.credits[i]; return NULL; }