diff options
Diffstat (limited to 'missing/strerror.c')
| -rw-r--r-- | missing/strerror.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/missing/strerror.c b/missing/strerror.c index 733e63d1de..d3b61c3f12 100644 --- a/missing/strerror.c +++ b/missing/strerror.c @@ -1,6 +1,6 @@ /* public domain rewrite of strerror(3) */ -#include "missing.h" +#include "ruby/missing.h" extern int sys_nerr; extern char *sys_errlist[]; @@ -8,12 +8,11 @@ extern char *sys_errlist[]; static char msg[50]; char * -strerror(error) - int error; +strerror(int error) { if (error <= sys_nerr && error > 0) { return sys_errlist[error]; } - sprintf(msg, "Unknown error (%d)", error); + snprintf(msg, sizeof(msg), "Unknown error (%d)", error); return msg; } |
