diff options
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c')
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c b/xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c index ffce7fe2c..63d3ff8c7 100644 --- a/xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c +++ b/xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c,v 1.1 2000/02/13 03:06:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c,v 1.2 2002/11/09 09:00:13 herrb Exp $ */ #include "X.h" #include "os.h" @@ -77,3 +77,16 @@ Xfree(pointer p) free(p); } +char * +Xstrdup(const char *s) +{ + char *sd; + + if (s == NULL) + return NULL; + + sd = (char *)Xalloc(strlen(s) + 1); + if (sd != NULL) + strcpy(sd, s); + return sd; +} |