From 1ad7b5dca2f77c18e9d12d3897e3ce240fd68596 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Dec 2013 12:50:28 +0530 Subject: [PATCH] Fix warnings when compiling hunspell --- src/hunspell/affentry.hxx | 4 ++-- src/hunspell/affixmgr.cxx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hunspell/affentry.hxx b/src/hunspell/affentry.hxx index eaf361fcce..a032d61ed4 100644 --- a/src/hunspell/affentry.hxx +++ b/src/hunspell/affentry.hxx @@ -27,7 +27,7 @@ public: struct hentry * checkword(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); - struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL); + struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); char * check_morph(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); @@ -90,7 +90,7 @@ public: // const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT); const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0); - struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL); + struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = FLAG_NULL); char * check_twosfx_morph(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = FLAG_NULL); diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx index 7f3c98160a..6e1003b18b 100644 --- a/src/hunspell/affixmgr.cxx +++ b/src/hunspell/affixmgr.cxx @@ -3639,6 +3639,7 @@ int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const c /* now parse the num lines to read in the remainder of the table */ char * nl; + size_t keywordlen = strlen(keyword); for (int j=0; j < numrl; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); @@ -3651,7 +3652,7 @@ int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const c if (*piece != '\0') { switch(i) { case 0: { - if (strncmp(piece, keyword, sizeof(keyword)) != 0) { + if (strncmp(piece, keyword, keywordlen) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); delete *rl; *rl = NULL;