Mail Archives: djgpp-workers/2000/12/29/06:52:19
--=====================_12133697==_
Content-Type: text/plain; charset="us-ascii"; format=flowed
As part of the little things fixed during my fcntl work, here is a
patch for strerror.c to eliminate the use of a "magic number" of
characters to copy.
--=====================_12133697==_
Content-Type: text/plain; charset="us-ascii"
diff -ruN djgpp-cvs/src/libc/ansi/string/strerror.c djgpp/src/libc/ansi/string/strerror.c
--- djgpp-cvs/src/libc/ansi/string/strerror.c Fri Jun 16 04:16:48 1995
+++ djgpp/src/libc/ansi/string/strerror.c Mon Dec 11 21:56:58 2000
@@ -1,3 +1,4 @@
+/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <stdio.h>
#include <string.h>
@@ -15,7 +16,7 @@
return(unconst(__sys_errlist[errnum], char *));
strcpy(ebuf, "Unknown error: ");
- cp = ebuf + 15;
+ cp = ebuf + strlen(ebuf);
if (errnum < 0)
{
*cp++ = '-';
--=====================_12133697==_
Content-Type: text/plain; charset="us-ascii"; format=flowed
---------------------------------------------------------
Peter J. Farley III (pjfarley AT dorsai DOT org OR
pjfarley AT banet DOT net)
--=====================_12133697==_--
- Raw text -