uudecode: fix buggy check for empty filename
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 18 Oct 2011 10:07:05 +0000 (12:07 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 18 Oct 2011 10:07:05 +0000 (12:07 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/uudecode.c

index 6ecfe6ceffa076e028fe1dcae30848533bb74df7..23ff711fa6481e01909e6d331b6d9e22f2892ef6 100644 (file)
@@ -125,10 +125,11 @@ int uudecode_main(int argc UNUSED_PARAM, char **argv)
                mode = bb_strtou(line_ptr, NULL, 8);
                if (outname == NULL) {
                        outname = strchr(line_ptr, ' ');
-                       if ((outname == NULL) || (*outname == '\0')) {
+                       if (!outname)
                                break;
-                       }
                        outname++;
+                       if (!outname[0])
+                               break;
                }
                dst_stream = stdout;
                if (NOT_LONE_DASH(outname)) {