svn commit: trunk/uClibc/test/misc
vapier at uclibc.org
vapier at uclibc.org
Wed Feb 15 04:21:05 UTC 2006
Author: vapier
Date: 2006-02-14 20:21:04 -0800 (Tue, 14 Feb 2006)
New Revision: 14030
Log:
cleanup code to fix misc warnings
Modified:
trunk/uClibc/test/misc/stdarg.c
Changeset:
Modified: trunk/uClibc/test/misc/stdarg.c
===================================================================
--- trunk/uClibc/test/misc/stdarg.c 2006-02-15 04:03:24 UTC (rev 14029)
+++ trunk/uClibc/test/misc/stdarg.c 2006-02-15 04:21:04 UTC (rev 14030)
@@ -1,19 +1,23 @@
/* copied from rsync */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <stdarg.h>
-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"); }
More information about the uClibc-cvs
mailing list