From 8df0d1ea8731e765583a623d9836fcaded487652 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 21 Aug 2000 08:53:28 +0000 Subject: [PATCH] Fix one more place which assumed that key was NUL terminated. --- ChangeLog | 4 ++-- src/list-node.cc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13cdfb7..377497a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 . (parse_line): New function. (Key_List::read_keys): Call parse_line instead of new List_Node. diff --git a/src/list-node.cc b/src/list-node.cc index 1b6e142..57a04a0 100644 --- a/src/list-node.cc +++ b/src/list-node.cc @@ -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); } }