diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-05-17 21:59:47 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-05-17 21:59:47 -0700 |
commit | dc686289695aa3cef2b0b17d14fae68ac54643de (patch) | |
tree | aa12a2ee892ca9143d9d2089094196226a41e009 | |
parent | f393be55ace1de85445cb1f24fdf235d6644874a (diff) |
Replace malloc(strlen)+strcpy with strdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xclipboard.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/xclipboard.c b/xclipboard.c index 512aa5b..e64f6fe 100644 --- a/xclipboard.c +++ b/xclipboard.c @@ -345,9 +345,7 @@ AcceptSaveFile(Widget w, XEvent *e, String *argv, Cardinal *argc) { if (currentClip->filename) free (currentClip->filename); - currentClip->filename = malloc (strlen (filename) + 1); - if (currentClip->filename) - strcpy (currentClip->filename, filename); + currentClip->filename = strdup (filename); } } |