1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Fix one more place which assumed that key was NUL terminated.

This commit is contained in:
Bruno Haible
2000-08-21 08:53:28 +00:00
parent fb70031952
commit 8df0d1ea87
2 changed files with 4 additions and 3 deletions

View File

@@ -36,8 +36,8 @@
New field char_set_length.
(List_Node constructor): Accept key and rest, not the entire line.
* src/list-node.cc (List_Node constructor): Accept key and rest, not
the entire line. Don't NUL terminate key and char_set. Initialize
char_set_length field.
the entire line. Don't NUL terminate key and char_set. Specify
explicit length of key. Initialize char_set_length field.
* src/key-list.cc: Include <ctype.h>.
(parse_line): New function.
(Key_List::read_keys): Call parse_line instead of new List_Node.

View File

@@ -88,7 +88,8 @@ List_Node::List_Node (const char *k, int len, const char *r):
keylength, so there are essentially no usable hash positions! */
if (ptr == char_set && option[NOLENGTH])
{
fprintf (stderr, "Can't hash keyword %s with chosen key positions.\n", key);
fprintf (stderr, "Can't hash keyword %.*s with chosen key positions.\n",
key_length, key);
exit (1);
}
}