comparison pads2gpcb/util.c @ 63:455a0051f9d2

pads2gpcb: PARTTYPE parsing implemented, compiles
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 31 Jan 2016 07:32:08 +0000
parents
children
comparison
equal deleted inserted replaced
62:9d7e2937883d 63:455a0051f9d2
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <strings.h>
5
6 char *
7 savestr(srcstr)
8 char *srcstr;
9 {
10 char *buf;
11
12 buf = malloc(strlen(srcstr) + 1);
13 if (!buf) {
14 perror("malloc in savestr");
15 exit(1);
16 }
17 strcpy(buf, srcstr);
18 return(buf);
19 }