From 089d8c544fb694cc38de5a1dac3e78022b7c835a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 1 May 2001 04:16:28 +0000 Subject: added more complete C99 snprintf test (This used to be commit 4d7565342d5b53dd038bf25dd6c6afc7132ba2aa) --- source3/configure.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/configure.in') diff --git a/source3/configure.in b/source3/configure.in index e65d89ef4b..3083901f72 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -812,11 +812,16 @@ AC_TRY_RUN([ void foo(const char *format, ...) { va_list ap; int len; + char buf[5]; + va_start(ap, format); len = vsnprintf(0, 0, format, ap); va_end(ap); - if (len == 5) exit(0); - exit(1); + if (len != 5) exit(1); + + if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); + + exit(0); } main() { foo("hello"); } ], -- cgit