When checking for symbols with excessively long names, account for null terminating character.
Unified · Split
| @@ -118,8 +118,8 @@ static int read_symbol(FILE *in, struct sym_entry *s) · 117 unmodified lines | ||
| 118 | 118 | fprintf(stderr, "Read error or end of file.\n"); |
| 119 | 119 | return -1; |
| 120 | 120 | } |
| 121 | − if (strlen(sym) > KSYM_NAME_LEN) { | |
| 122 | − fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n" | |
| 121 | + if (strlen(sym) >= KSYM_NAME_LEN) { | |
| 122 | + fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n" | |
| 123 | 123 | "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n", |
| 124 | 124 | sym, strlen(sym), KSYM_NAME_LEN); |
| 125 | 125 | return -1; |