From 04dc87e01247ab2ba932af0911e77ca1d711cf0f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 5 Jan 2011 21:17:30 -0600 Subject: vercmp: always return 0 if we perform a compare And change the wording slightly to indicate we *print* a value, not *return* it. You can't return negative values (they get coerced to 255), so it isn't worth it to try and cram the result into the return code. Acked-by: Allan McRae Signed-off-by: Dan McGee --- src/util/vercmp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/util/vercmp.c b/src/util/vercmp.c index 8a785bb8..ea6722fa 100644 --- a/src/util/vercmp.c +++ b/src/util/vercmp.c @@ -18,6 +18,7 @@ * along with this program. If not, see . */ +#include #include /* printf */ #include /* strncpy */ @@ -30,7 +31,7 @@ int alpm_pkg_vercmp(const char *a, const char *b); static void usage(void) { fprintf(stderr, "usage: %s \n\n", BASENAME); - fprintf(stderr, "return values:\n"); + fprintf(stderr, "output values:\n"); fprintf(stderr, " < 0 : if ver1 < ver2\n"); fprintf(stderr, " 0 : if ver1 == ver2\n"); fprintf(stderr, " > 0 : if ver1 > ver2\n"); @@ -61,5 +62,5 @@ int main(int argc, char *argv[]) ret = alpm_pkg_vercmp(s1, s2); printf("%d\n", ret); - return(ret); + return(EXIT_SUCCESS); } -- cgit v1.2.3-70-g09d2