libgrep: Fix issues detected by gcc -Wformat-security

* m-fgrep.c (Fcompile): Supply FORMAT argument of error.
* m-regex.c (compile): Likewise.
This commit is contained in:
Ivailo 2013-12-05 18:56:20 +09:00 committed by Daiki Ueno
parent 1cbe8e4753
commit ea77f13f7e
3 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2013-12-05 Ivailo <xakepa10@gmail.com> (tiny change)
libgrep: Fix issues detected by gcc -Wformat-security
* m-fgrep.c (Fcompile): Supply FORMAT argument of error.
* m-regex.c (compile): Likewise.
2012-12-25 Daiki Ueno <ueno@gnu.org>
* gettext-0.18.2 released.

View File

@ -106,7 +106,7 @@ Fcompile (const char *pattern, size_t pattern_size,
for (lim = beg; lim < pattern + pattern_size && *lim != '\n'; ++lim)
;
if ((err = kwsincr (ckwset->kwset, beg, lim - beg)) != NULL)
error (exit_failure, 0, err);
error (exit_failure, 0, "%s", err);
if (lim < pattern + pattern_size)
++lim;
beg = lim;
@ -114,7 +114,7 @@ Fcompile (const char *pattern, size_t pattern_size,
while (beg < pattern + pattern_size);
if ((err = kwsprep (ckwset->kwset)) != NULL)
error (exit_failure, 0, err);
error (exit_failure, 0, "%s", err);
return ckwset;
}

View File

@ -106,7 +106,7 @@ compile (const char *pattern, size_t pattern_size,
if ((err = re_compile_pattern (motif, len,
&cregex->patterns[cregex->pcount].regexbuf)) != NULL)
error (exit_failure, 0, err);
error (exit_failure, 0, "%s", err);
cregex->pcount++;
motif = sep;