summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--posix/regexbug1.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index de2e7ccbbd..59d95d166f 100644
--- a/ChangeLog
+++ b/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
diff --git a/posix/regexbug1.c b/posix/regexbug1.c
index 28640968d0..17643e7e4d 100644
--- a/posix/regexbug1.c
+++ b/posix/regexbug1.c
@@ -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)
@@ -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)