ld: don't break if the symbol unused bytes are nn zero
authorAlan Cox <alan@linux.intel.com>
Mon, 30 Oct 2017 17:42:25 +0000 (17:42 +0000)
committerAlan Cox <alan@linux.intel.com>
Mon, 30 Oct 2017 17:42:25 +0000 (17:42 +0000)
Applications/MWC/cmd/asz80/ld.c

index 0fdc7ea..a1802f9 100644 (file)
@@ -128,11 +128,10 @@ struct symbol *find_symbol(const char *name, int hash)
 static uint8_t hash_symbol(const char *name)
 {
        int hash = 0;
-       uint8_t n = 16;
+       uint8_t n = 0;
 
-       do {
+       while(*name && n++ < 16)
                hash += *name++;
-       } while (--n);
        return (hash&(NHASH-1));
 }