From 2ce53a38d821d67cdf7a7082f9c42da88516e890 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 28 Dec 2007 14:05:53 +0100 Subject: [PATCH] com_lsatt(): Fix error message. We must not use PARA_STRERROR(-ret) if ret is zero. --- attribute.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/attribute.c b/attribute.c index 5f7188ee..dd1be5d8 100644 --- a/attribute.c +++ b/attribute.c @@ -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; } -- 2.39.5