From c8afb5af061830a1fb9637d67142b3e71e535265 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Mon, 30 Jun 2008 17:35:11 +0100 Subject: [PATCH] Similarly, remove copy_string from display_cow.c --- src/display_cow.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/display_cow.c b/src/display_cow.c index 8295256..4f786f1 100644 --- a/src/display_cow.c +++ b/src/display_cow.c @@ -136,14 +136,6 @@ void cowsay_init(int *argc, char ***argv) xcowsay.cow_pixbuf = load_cow(); } -static char *copy_string(const char *s) -{ - char *copy = malloc(strlen(s)+1); - g_assert(copy); - strcpy(copy, s); - return copy; -} - static int count_words(const char *s) { bool last_was_space = false; @@ -161,7 +153,7 @@ static int count_words(const char *s) static void normal_setup(const char *text, bool debug) { - char *text_copy = copy_string(text); + char *text_copy = strdup(text); // Trim any trailing newline size_t len = strlen(text_copy); -- 2.39.2