home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-05-30 | 409 b | 18 lines | [TEXT/MPS ] |
- % Copyright 1991 by Norman Ramsey. All rights reserved.
- % See file COPYRIGHT for more information.
- <<header>>=
- char *strsave (char *s); /* returns a pointer to a fresh copy of s */
- <<*>>=
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include "strsave.h"
- #include "errors.h"
-
- char *strsave (char *s) {
- char *t = malloc (strlen(s)+1);
- checkptr(t);
- strcpy(t,s);
- return t;
- }
-