chiark / gitweb /
core/mount: use isempty() to check for empty strings
authorDaniel Mack <daniel@zonque.org>
Mon, 12 Jan 2015 12:46:39 +0000 (13:46 +0100)
committerDaniel Mack <daniel@zonque.org>
Mon, 12 Jan 2015 13:01:45 +0000 (14:01 +0100)
strempty() will return an empty string in case the input parameter is
a NULL pointer. The correct test to check for an empty string is
isempty(), so use that instead.

This fixes a regression from commit 17a1c59 ("core/mount: filter out
noauto,auto,nofail,fail options").

src/core/mount.c

index 9f7c4d2..5c87ed3 100644 (file)
@@ -932,7 +932,7 @@ static void mount_enter_mounting(Mount *m) {
                         r = exec_command_append(m->control_command, "-s", NULL);
                 if (r >= 0 && m->parameters_fragment.fstype)
                         r = exec_command_append(m->control_command, "-t", m->parameters_fragment.fstype, NULL);
                         r = exec_command_append(m->control_command, "-s", NULL);
                 if (r >= 0 && m->parameters_fragment.fstype)
                         r = exec_command_append(m->control_command, "-t", m->parameters_fragment.fstype, NULL);
-                if (r >= 0 && !strempty(opts))
+                if (r >= 0 && !isempty(opts))
                         r = exec_command_append(m->control_command, "-o", opts, NULL);
         } else
                 r = -ENOENT;
                         r = exec_command_append(m->control_command, "-o", opts, NULL);
         } else
                 r = -ENOENT;