Browse Source

a few more strlcy; ok from beck & ho

OPENBSD_3_3
deraadt 22 years ago
parent
commit
e155dacb0f
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      src/lib/libc/string/__strerror.c
  2. +3
    -3
      src/lib/libc/string/__strsignal.c

+ 3
- 3
src/lib/libc/string/__strerror.c View File

@ -32,7 +32,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: __strerror.c,v 1.8 2001/12/08 20:37:32 deraadt Exp $";
static char *rcsid = "$OpenBSD: __strerror.c,v 1.9 2003/03/13 15:47:33 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#ifdef NLS #ifdef NLS
@ -98,9 +98,9 @@ __strerror(num, buf)
#ifdef NLS #ifdef NLS
strlcpy(buf, catgets(catd, 1, 0xffff, UPREFIX), NL_TEXTMAX); strlcpy(buf, catgets(catd, 1, 0xffff, UPREFIX), NL_TEXTMAX);
#else #else
strcpy(buf, UPREFIX);
strlcpy(buf, UPREFIX, NL_TEXTMAX);
#endif #endif
strncat(buf, itoa(errnum), NL_TEXTMAX-strlen(buf)-1);
strlcat(buf, itoa(errnum), NL_TEXTMAX);
errno = EINVAL; errno = EINVAL;
} }


+ 3
- 3
src/lib/libc/string/__strsignal.c View File

@ -32,7 +32,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: __strsignal.c,v 1.6 2001/06/27 00:58:56 lebel Exp $";
static char *rcsid = "$OpenBSD: __strsignal.c,v 1.7 2003/03/13 15:47:33 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#ifdef NLS #ifdef NLS
@ -89,9 +89,9 @@ __strsignal(num, buf)
#ifdef NLS #ifdef NLS
strlcpy(buf, catgets(catd, 1, 0xffff, UPREFIX), NL_TEXTMAX); strlcpy(buf, catgets(catd, 1, 0xffff, UPREFIX), NL_TEXTMAX);
#else #else
strcpy(buf, UPREFIX);
strlcpy(buf, UPREFIX, NL_TEXTMAX);
#endif #endif
strncat(buf, itoa(signum), NL_TEXTMAX-strlen(buf)-1);
strlcat(buf, itoa(signum), NL_TEXTMAX);
} }
#ifdef NLS #ifdef NLS


Loading…
Cancel
Save