/* (C) Copyright International Business Machines Corporation 23 January */
/* 1990.  All Rights Reserved. */
/*  */
/* See the file USERAGREEMENT distributed with this software for full */
/* terms and conditions of use. */
/* Miscellaneous routines for the MiniC parser
** Andy Lowry, Apr 1989
**/

char sccsid[] = "@(#)misc.c	1.2 3/13/90";

#include "minic.h"		/* get common declarations */


/* COPYSTRING

** Creates and returns a copy of the given string, in allocated
** storage that can be released via free().  Returns NULL if no
** storage is available
**/

char *
copystring(s)
char *s;
{
  char *copy;

  copy = malloc(strlen(s)+1);	/* allocate storage */
  if (copy != NULL)
    strcpy(copy,s);		/* copy string only if successful */
  return(copy);
}


