From 9b37b9c2985450e663420a0776d374080bf0f00c Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Sat, 16 Sep 2006 15:25:52 +0000 Subject: mycpy() created --- src/utils.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 3589563..166c6c4 100755 --- a/src/utils.c +++ b/src/utils.c @@ -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 @@ -641,3 +641,14 @@ long now(void) current_time = time(NULL); 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; +} -- cgit v1.2.3-70-g09d2