]> git.sur5r.net Git - c128-kasse/commitdiff
defined NICKNAME_MAX_LEN
authormatze <matze@af93e077-1a23-4f1e-9cbe-9382a9d578f5>
Fri, 26 Oct 2007 01:45:37 +0000 (01:45 +0000)
committermatze <matze@af93e077-1a23-4f1e-9cbe-9382a9d578f5>
Fri, 26 Oct 2007 01:45:37 +0000 (01:45 +0000)
git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@65 af93e077-1a23-4f1e-9cbe-9382a9d578f5

include/config.h
src/credit_manager.c

index 5393a56feb6678cee367356328caeae483629704..02513a461de15f0148a5a19995572093071690e0 100644 (file)
@@ -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;
 };
index c6e56160b0cc2608288dd2f0000b81bde77efef5..8198d7e4c435ca00fa0f7c09fead63ee0a6fb329 100644 (file)
@@ -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;
 }