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