summaryrefslogtreecommitdiff
path: root/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'stdio')
-rw-r--r--stdio/perror.c4
-rw-r--r--stdio/vfprintf.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/stdio/perror.c b/stdio/perror.c
index 718a6f2256..1054acaa7d 100644
--- a/stdio/perror.c
+++ b/stdio/perror.c
@@ -20,7 +20,7 @@ Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <errno.h>
-extern char *_strerror_internal __P ((int, char buf[1024]));
+extern char *_strerror_internal __P ((int, char *buf, size_t));
/* Print a line on stderr consisting of the text in S, a colon, a space,
a message describing the meaning of the contents of `errno' and a newline.
@@ -38,5 +38,5 @@ DEFUN(perror, (s), register CONST char *s)
colon = ": ";
(void) fprintf (stderr, "%s%s%s\n",
- s, colon, _strerror_internal (errnum, buf));
+ s, colon, _strerror_internal (errnum, buf, sizeof buf));
}
diff --git a/stdio/vfprintf.c b/stdio/vfprintf.c
index 06aa0a0e7d..63a5148463 100644
--- a/stdio/vfprintf.c
+++ b/stdio/vfprintf.c
@@ -534,7 +534,7 @@ vfprintf (s, format, ap)
else if (specs[cnt].info.prec != -1)
{
/* Search for the end of the string, but don't search
- past the length specified by the precision. */
+ past the length specified by the precision. */
const char *end = memchr (str, '\0', specs[cnt].info.prec);
if (end)
len = end - str;
@@ -600,8 +600,8 @@ vfprintf (s, format, ap)
case 'm':
{
- extern char *_strerror_internal __P ((int, char buf[1024]));
- str = _strerror_internal (errno, errorbuf);
+ extern char *_strerror_internal __P ((int, char *buf, size_t));
+ str = _strerror_internal (errno, errorbuf, sizeof errorbuf);
goto string;
}