mycpy() created

This commit is contained in:
Frederic Culot 2006-09-16 15:25:52 +00:00
parent 6486777715
commit 9b37b9c298

View File

@ -1,4 +1,4 @@
/* $calcurse: utils.c,v 1.8 2006/09/16 09:09:39 culot Exp $ */ /* $calcurse: utils.c,v 1.9 2006/09/16 15:25:52 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -641,3 +641,14 @@ long now(void)
current_time = time(NULL); current_time = time(NULL);
return current_time; return current_time;
} }
/* Copy a string */
char *mycpy(const char *src)
{
char *string = malloc(strlen(src) + 1);
if (string != NULL)
return strcpy(string, src);
else
return NULL;
}