*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: malloc.c,v 1.11 1996/09/15 09:31:49 tholo Exp $";
+static char rcsid[] = "$OpenBSD: malloc.c,v 1.12 1996/09/16 05:43:40 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
/*
/*
* Defining MALLOC_STATS will enable you to call malloc_dump() and set
* the [dD] options in the MALLOC_OPTIONS environment variable.
- * It has no run-time performance hit.
+ * It has no run-time performance hit, but does pull in stdio...
*/
-#define MALLOC_STATS
+#undef MALLOC_STATS
#if defined(EXTRA_SANITY) && !defined(MALLOC_STATS)
# define MALLOC_STATS /* required for EXTRA_SANITY */
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: __strerror.c,v 1.4 1996/09/15 09:31:53 tholo Exp $";
+static char *rcsid = "$OpenBSD: __strerror.c,v 1.5 1996/09/16 05:43:38 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#ifdef NLS
#include <stdio.h>
#include <string.h>
+static char *itoa(num)
+ int num;
+{
+ static char buffer[11];
+ char *p;
+
+ p = buffer + 4;
+ while (num >= 10) {
+ *--p = (num % 10) + '0';
+ num /= 10;
+ }
+ *p = (num % 10) + '0';
+ return p;
+}
+
/*
* Since perror() is not allowed to change the contents of strerror()'s
* static buffer, both functions supply their own buffers to the
int num;
char *buf;
{
-#define UPREFIX "Unknown error: %u"
+#define UPREFIX "Unknown error: "
register unsigned int errnum;
#ifdef NLS
#endif
} else {
#ifdef NLS
- sprintf(buf, catgets(catd, 1, 0xffff, UPREFIX), errnum);
+ strcpy(buf, catgets(catd, 1, 0xffff, UPREFIX));
#else
- sprintf(buf, UPREFIX, errnum);
+ strcpy(buf, UPREFIX);
#endif
+ strcat(buf, itoa(errnum));
}
#ifdef NLS
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: __strsignal.c,v 1.2 1996/08/19 08:33:56 tholo Exp $";
+static char *rcsid = "$OpenBSD: __strsignal.c,v 1.3 1996/09/16 05:43:39 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#ifdef NLS
#include <signal.h>
#include <string.h>
+static char *itoa(num)
+ int num;
+{
+ static char buffer[11];
+ char *p;
+
+ p = buffer + 4;
+ while (num >= 10) {
+ *--p = (num % 10) + '0';
+ num /= 10;
+ }
+ *p = (num % 10) + '0';
+ return p;
+}
+
char *
__strsignal(num, buf)
int num;
char *buf;
{
-#define UPREFIX "Unknown signal: %u"
+#define UPREFIX "Unknown signal: "
register unsigned int signum;
#ifdef NLS
#endif
} else {
#ifdef NLS
- sprintf(buf, catgets(catd, 1, 0xffff, UPREFIX), signum);
+ strcpy(buf, catgets(catd, 1, 0xffff, UPREFIX));
#else
- sprintf(buf, UPREFIX, signum);
+ strcpy(buf, UPREFIX);
#endif
+ strcat(buf, itoa(signum));
}
#ifdef NLS