diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-08-20 17:52:25 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-08-20 17:52:25 -0700 |
commit | bdbbaa94ea75511dd7f5dd8573b6772dab56e55e (patch) | |
tree | 93f18c942f4e83e15595caa4ba1ffb2a3c6daa51 /xcursorgen.c | |
parent | e5c1a83c1b8f71615d2fe724456bc044d9799efa (diff) |
Use strdup instead of malloc/strlen/strcpy
Diffstat (limited to 'xcursorgen.c')
-rw-r--r-- | xcursorgen.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/xcursorgen.c b/xcursorgen.c index 3e09c1a..17902a0 100644 --- a/xcursorgen.c +++ b/xcursorgen.c @@ -117,16 +117,14 @@ read_config_file (char *config, struct flist **list) curr->delay = delay; - curr->pngfile = malloc (strlen (pngfile) + 1); + curr->pngfile = strdup (pngfile); if (curr->pngfile == NULL) { - fprintf (stderr, "malloc() failed\n"); + fprintf (stderr, "strdup() failed\n"); fclose (fp); free(curr); return 0; } - - strcpy (curr->pngfile, pngfile); curr->next = NULL; |