From 8c03a278003a103edfc5d48f52a3ebeea687d0be Mon Sep 17 00:00:00 2001 From: matze Date: Fri, 26 Oct 2007 01:45:37 +0000 Subject: [PATCH] defined NICKNAME_MAX_LEN git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@65 af93e077-1a23-4f1e-9cbe-9382a9d578f5 --- include/config.h | 3 ++- src/credit_manager.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.39.5