source: trunk/third/xscreensaver/utils/vms-strdup.c @ 12203

Revision 12203, 495 bytes checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12202, which included commits to RCS files with non-trunk default branches.
Line 
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
18char* 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
Note: See TracBrowser for help on using the repository browser.