From 5e3a21913b6a47e78d3e4edd4238d028b90827b7 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 4 Dec 2001 21:12:40 +0000 Subject: This update should bring the Windows Help back end up to near-complete functionality. All that's missing now is indexing and horizontal rules. [originally from svn r1449] --- malloc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'malloc.c') diff --git a/malloc.c b/malloc.c index 0f42bde..e9f54d6 100644 --- a/malloc.c +++ b/malloc.c @@ -88,6 +88,16 @@ void *(srealloc)(LOGPARAMS void *p, int size) { } /* + * dupstr is like strdup, but with the never-return-NULL property + * of smalloc (and also reliably defined in all environments :-) + */ +char *dupstr(char *s) { + char *r = smalloc(1+strlen(s)); + strcpy(r,s); + return r; +} + +/* * Duplicate a linked list of words */ word *dup_word_list(word *w) { -- cgit v1.1