ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libukcprog/src/strsave.c
Revision: 1.1
Committed: Sat Mar 29 16:30:33 2003 UTC (21 years, 8 months ago) by tdb
Content type: text/plain
Branch: MAIN
CVS Tags: LIBUKCPROG_1_0_2, LIBUKCPROG_1_0_1, LIBUKCPROG_1_0, HEAD
Log Message:
libukcprog is now a seperate package. I doubt this will be much use to
anyone other than us, but I see no reason why we can't package it up
and distribute it. Obviously we can't attach the GPL to this, as we
don't own it.

File Contents

# Content
1 /* strsave.c -- allocate memory and save a copy of a string */
2
3 /* Copyright 1992 Godfrey Paul, University of Kent at Canterbury.
4 *
5 * You can do what you like with this source code as long as
6 * you don't try to make money out of it and you include an
7 * unaltered copy of this message (including the copyright).
8 */
9
10 char ukcprog_strsave_sccsid[] = "$Id: strsave.c,v 1.7 1993/05/30 18:15:06 gjap Exp $ UKC";
11
12 #include <string.h>
13 #include <stdlib.h> /* for malloc() */
14
15 #include "ukcprog.h"
16
17
18 char *
19 strsave(s)
20 const char *s;
21 {
22 char *str;
23
24 str = e_malloc(strlen(s) + 1);
25
26 return strcpy(str, s);
27 }