ftp://ftp.smr.ru/pub/0/FreeBSD/releases/distfiles/xscreensaver-3.16.tar.gz
[xscreensaver] / utils / vms-strdup.c
1 /*
2  * strdup.c
3  *
4  * Simple version of strdup for machines without it (ie DEC Ultrix 4.2)
5  * Apparently VMS only got strdup in 1995 (v5.2...)
6  *
7  * By David Chatterton
8  * 29 July 1993
9  *
10  * You can do anything you like to this... :)
11  * I've stolen it from xpilot and added it to the xvmstuils MPJZ ;-)
12  */
13
14 #if (__VMS_VER < 70000000)
15 #include <stdlib.h>
16 #include <string.h>
17
18 char* strdup (const char* s1)
19 {
20         char* s2;
21         if (s2 = (char*)malloc(strlen(s1)+1))
22                 strcpy(s2,s1);
23         return s2;
24 }
25 #endif