From e7c9757f6834fe629c88adbd181f35cd69b5e456 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 2 Dec 2002 12:58:51 +0000 Subject: [PATCH] Fix uninitialized variable bug. --- ChangeLog | 4 ++++ src/keyword.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 712988f..836b74f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2002-11-02 Bruno Haible + Bug fix. + * src/keyword.cc (KeywordExt::init_selchars): Avoid comparison with + uninitialized member variable. Found with 'valgrind'. + * src/version.cc: Include version.h. * src/Makefile.in (OBJECTS): Reorder. (KEYWORD_H, KEYWORD_LIST_H, INPUT_H, SEARCH_H, OUTPUT_H): New diff --git a/src/keyword.cc b/src/keyword.cc index 3f6bb9a..ad65dd9 100644 --- a/src/keyword.cc +++ b/src/keyword.cc @@ -97,8 +97,8 @@ void KeywordExt::init_selchars (int *occurrences) } /* Didn't get any hits and user doesn't want to consider the - keylength, so there are essentially no usable hash positions! */ - if (ptr == _selchars && option[NOLENGTH]) + keylength, so there are essentially no usable hash positions! */ + if (ptr == key_set && option[NOLENGTH]) { fprintf (stderr, "Can't hash keyword %.*s with chosen key positions.\n", _allchars_length, _allchars);