From e78b1fdf66df1d9d3c2822c4799a27c25f4c810a Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 17 Sep 2013 12:48:11 +0400 Subject: [PATCH] Remove redundant checks for g_strdup(). Signed-off-by: Andrew Borodin --- lib/tty/color.c | 6 +++--- lib/vfs/vfs.c | 2 +- src/vfs/extfs/extfs.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tty/color.c b/lib/tty/color.c index 5e0d53238..7c87ed55f 100644 --- a/lib/tty/color.c +++ b/lib/tty/color.c @@ -236,9 +236,9 @@ tty_color_set_defaults (const char *fgcolor, const char *bgcolor, const char *at g_free (tty_color_defaults__bg); g_free (tty_color_defaults__attrs); - tty_color_defaults__fg = (fgcolor != NULL) ? g_strdup (fgcolor) : NULL; - tty_color_defaults__bg = (bgcolor != NULL) ? g_strdup (bgcolor) : NULL; - tty_color_defaults__attrs = (attrs != NULL) ? g_strdup (attrs) : NULL; + tty_color_defaults__fg = g_strdup (fgcolor); + tty_color_defaults__bg = g_strdup (bgcolor); + tty_color_defaults__attrs = g_strdup (attrs); } /* --------------------------------------------------------------------------------------------- */ diff --git a/lib/vfs/vfs.c b/lib/vfs/vfs.c index 1ec0937fc..6e0b3369b 100644 --- a/lib/vfs/vfs.c +++ b/lib/vfs/vfs.c @@ -354,7 +354,7 @@ vfs_translate_path_n (const char *path) const char *result; result = vfs_translate_path (path); - return (result != NULL) ? g_strdup (result) : NULL; + return g_strdup (result); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/vfs/extfs/extfs.c b/src/vfs/extfs/extfs.c index f24bd76d1..4463a69a4 100644 --- a/src/vfs/extfs/extfs.c +++ b/src/vfs/extfs/extfs.c @@ -449,7 +449,7 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc) current_archive = g_new (struct archive, 1); current_archive->fstype = fstype; - current_archive->name = (name != NULL) ? g_strdup (name) : NULL; + current_archive->name = g_strdup (name); current_archive->local_name = g_strdup (vfs_path_get_last_path_str (local_name_vpath)); if (local_name_vpath != NULL)