view pads2gpcb/util.c @ 81:6e43956e740d

beginning of BOM utils refactoring: seqrefdes code factored out
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 23 Feb 2017 19:15:48 +0000
parents 455a0051f9d2
children
line wrap: on
line source

#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);
}