From aa5545711b28f601973ee497fa3b646278f339d2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 15 Feb 2006 04:21:04 +0000 Subject: cleanup code to fix misc warnings --- test/misc/stdarg.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/misc/stdarg.c b/test/misc/stdarg.c index ca723355a..561fd2c3b 100644 --- a/test/misc/stdarg.c +++ b/test/misc/stdarg.c @@ -1,19 +1,23 @@ /* copied from rsync */ +#include +#include +#include #include #include -void foo(const char *format, ...) { +int foo(const char *format, ...) +{ va_list ap; - int len; + size_t len; char buf[5]; va_start(ap, format); len = vsnprintf(0, 0, format, ap); va_end(ap); - if (len != 5) exit(1); + if (len != 5) return(1); - if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); + if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) return(1); - exit(0); + return(0); } -int main() { foo("hello"); } +int main(void) { return foo("hello"); } -- cgit v1.2.3