]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
com_lsatt(): Fix error message.
authorAndre Noll <maan@systemlinux.org>
Fri, 28 Dec 2007 13:05:53 +0000 (14:05 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 28 Dec 2007 13:05:53 +0000 (14:05 +0100)
We must not use PARA_STRERROR(-ret) if ret is zero.

attribute.c

index 5f7188ee30b58ee84f5800d7059cbfb014e8c09a..dd1be5d89ae4f1298250c1e9bbd4eab06d5b376b 100644 (file)
@@ -200,13 +200,15 @@ int com_lsatt(int fd, int argc, char * const * const argv)
                        continue;
                }
        }
-       ret = send_option_arg_callback_request(&options, argc -i, argv + i,
+       ret = send_option_arg_callback_request(&options, argc - i, argv + i,
                com_lsatt_callback, &result);
        if (ret > 0) {
                ret = send_buffer(fd, (char *)result.data);
                free(result.data);
-       } else
+       } else if (ret < 0)
                send_va_buffer(fd, "%s\n", PARA_STRERROR(-ret));
+       else if (argc > 1)
+               send_va_buffer(fd, "no matches\n");
        return ret;
 }