1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Ignore ELF symbols containing dots or dollar signs. Suggested by millert@

This commit is contained in:
miod 2015-02-07 02:56:00 +00:00
parent 4d2fa9d8f9
commit 5af213f8f7

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ksyms.c,v 1.5 2015/02/07 01:37:30 miod Exp $ */
/* $OpenBSD: ksyms.c,v 1.6 2015/02/07 02:56:00 miod Exp $ */
/*
* Copyright (c) 2008 Miodrag Vallat.
@ -27,7 +27,7 @@
#include "hangman.h"
int ksyms_elf_parse();
static int ksyms_elf_parse(void);
void
sym_getword()
@ -57,7 +57,8 @@ sym_getword()
buflen = symsize - pos;
*(end = symbuf + buflen) = '\0';
for (sym = symbuf; *sym != '\0'; sym++) ;
for (sym = symbuf; *sym != '\0'; sym++)
;
if (sym == end)
continue;
@ -65,13 +66,17 @@ sym_getword()
if (symlen < MINLEN || symlen > MAXLEN)
continue;
/* ignore symbols containing dots or dollar signs */
if (strchr(sym, '.') != NULL || strchr(sym, '$') != NULL)
continue;
break;
}
if (tries >= MAXBADWORDS) {
mvcur(0, COLS - 1, LINES -1, 0);
endwin();
errx(1, "can't seem a suitable kernel symbol in %s",
errx(1, "can't seem a suitable symbol in %s",
Dict_name);
}