summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/stpcpy.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libc/string/stpcpy.c (renamed from src/lib/libc/string/__strsignal.c)62
1 files changed, 10 insertions, 52 deletions
diff --git a/src/lib/libc/string/__strsignal.c b/src/lib/libc/string/stpcpy.c
index 1937e2d608..d3d61e0f14 100644
--- a/src/lib/libc/string/__strsignal.c
+++ b/src/lib/libc/string/stpcpy.c
@@ -1,3 +1,5 @@
1/* $OpenBSD: stpcpy.c,v 1.1 2012/01/17 02:48:01 guenther Exp $ */
2
1/* 3/*
2 * Copyright (c) 1988 Regents of the University of California. 4 * Copyright (c) 1988 Regents of the University of California.
3 * All rights reserved. 5 * All rights reserved.
@@ -10,11 +12,7 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software 15 * 3. Neither the name of the University nor the names of its contributors
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software 16 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission. 17 * without specific prior written permission.
20 * 18 *
@@ -31,56 +29,16 @@
31 * SUCH DAMAGE. 29 * SUCH DAMAGE.
32 */ 30 */
33 31
34#if defined(LIBC_SCCS) && !defined(lint) 32#include <string.h>
35/*static char *sccsid = "from: @(#)strerror.c 5.6 (Berkeley) 5/4/91";*/
36static char *rcsid = "$Id: __strsignal.c,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $";
37#endif /* LIBC_SCCS and not lint */
38 33
39#ifdef NLS 34#if defined(APIWARN)
40#define catclose _catclose 35__warn_references(stpcpy,
41#define catgets _catgets 36 "warning: stpcpy() is dangerous GNU crap; don't use it");
42#define catopen _catopen
43#include <nl_types.h>
44#endif 37#endif
45 38
46#define sys_siglist _sys_siglist
47
48#include <stdio.h>
49#include <signal.h>
50#include <string.h>
51
52char * 39char *
53__strsignal(num, buf) 40stpcpy(char *to, const char *from)
54 int num;
55 char *buf;
56{ 41{
57#define UPREFIX "Unknown signal: %u" 42 for (; (*to = *from) != '\0'; ++from, ++to);
58 register unsigned int signum; 43 return(to);
59
60#ifdef NLS
61 nl_catd catd ;
62 catd = catopen("libc", 0);
63#endif
64
65 signum = num; /* convert to unsigned */
66 if (signum < NSIG) {
67#ifdef NLS
68 strcpy(buf, catgets(catd, 2, signum,
69 (char *)sys_siglist[signum]));
70#else
71 return((char *)sys_siglist[signum]);
72#endif
73 } else {
74#ifdef NLS
75 sprintf(buf, catgets(catd, 1, 0xffff, UPREFIX), signum);
76#else
77 sprintf(buf, UPREFIX, signum);
78#endif
79 }
80
81#ifdef NLS
82 catclose(catd);
83#endif
84
85 return buf;
86} 44}