diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pads2gpcb/util.c	Sun Jan 31 07:32:08 2016 +0000
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+
+char *
+savestr(srcstr)
+	char *srcstr;
+{
+	char *buf;
+
+	buf = malloc(strlen(srcstr) + 1);
+	if (!buf) {
+		perror("malloc in savestr");
+		exit(1);
+	}
+	strcpy(buf, srcstr);
+	return(buf);
+}