summaryrefslogtreecommitdiffstats
path: root/lib/libcurses/tinfo/doalloc.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-03-02 06:23:26 +0000
committermillert <millert@openbsd.org>1999-03-02 06:23:26 +0000
commitfeef4803a40c592364b218e74a951c67178917ec (patch)
treeaa10d366e07c2efb3312c722b5ee1db12b239b36 /lib/libcurses/tinfo/doalloc.c
parentIgnore TX interrupts when there are not packets buffered. (diff)
downloadwireguard-openbsd-feef4803a40c592364b218e74a951c67178917ec.tar.xz
wireguard-openbsd-feef4803a40c592364b218e74a951c67178917ec.zip
ncurses-4.2-990301
Diffstat (limited to 'lib/libcurses/tinfo/doalloc.c')
-rw-r--r--lib/libcurses/tinfo/doalloc.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/libcurses/tinfo/doalloc.c b/lib/libcurses/tinfo/doalloc.c
index a4d293e77ec..43b6017e35c 100644
--- a/lib/libcurses/tinfo/doalloc.c
+++ b/lib/libcurses/tinfo/doalloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: doalloc.c,v 1.1 1999/01/18 19:10:15 millert Exp $ */
+/* $OpenBSD: doalloc.c,v 1.2 1999/03/02 06:23:28 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -42,7 +42,7 @@
#include <curses.priv.h>
-MODULE_ID("$From: doalloc.c,v 1.2 1998/08/18 22:52:39 Hans-Joachim.Widmaier Exp $")
+MODULE_ID("$From: doalloc.c,v 1.4 1999/02/27 19:58:33 tom Exp $")
void *_nc_doalloc(void *oldp, size_t amount)
{
@@ -54,7 +54,23 @@ void *_nc_doalloc(void *oldp, size_t amount)
errno = ENOMEM; /* just in case 'free' reset */
}
} else {
- newp = malloc(amount);
+ newp = typeMalloc(char, amount);
}
return newp;
}
+
+#if !HAVE_STRDUP
+char *_nc_strdup(char *src)
+{
+ char *dst;
+ if (src != 0) {
+ char *dst = typeMalloc(char, strlen(src) + 1);
+ if (dst != 0) {
+ (void)strcpy(dst, src):
+ }
+ } else {
+ dst = 0;
+ }
+ return dst;
+}
+#endif