Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix -Wformat-security warnings in posix/regexbug1.c
  • Loading branch information
Roland McGrath committed Dec 11, 2014
1 parent f627ca8 commit e9813cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2014-12-11 Roland McGrath <roland@hack.frob.com>

* posix/regexbug1.c (main): Use "%s" format with regerror results,
rather than assuming they won't contain any '%'s.

2014-12-11 Chris Metcalf <cmetcalf@ezchip.com>

* sysdeps/tile/tilegx/memset.c (__memcpy): Add
Expand Down
4 changes: 2 additions & 2 deletions posix/regexbug1.c
Expand Up @@ -18,7 +18,7 @@ main (void)
{
char buf[100];
regerror (reerr, &re, buf, sizeof buf);
error (EXIT_FAILURE, 0, buf);
error (EXIT_FAILURE, 0, "%s", buf);
}

if (regexec (&re, "002", 2, ma, 0) != 0)
Expand All @@ -35,7 +35,7 @@ main (void)
{
char buf[100];
regerror (reerr, &re, buf, sizeof buf);
error (EXIT_FAILURE, 0, buf);
error (EXIT_FAILURE, 0, "%s", buf);
}

if (regexec (&re, "002", 2, ma, 0) != 0)
Expand Down

0 comments on commit e9813cf

Please sign in to comment.