summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-05-01 04:16:28 +0000
committerAndrew Tridgell <tridge@samba.org>2001-05-01 04:16:28 +0000
commit089d8c544fb694cc38de5a1dac3e78022b7c835a (patch)
treedcd5653ef312ac021115c7edc99ede778a53bbe1 /source3/configure.in
parent7e82811d2d1b9ed06767625fff12755ced83bcad (diff)
downloadsamba-089d8c544fb694cc38de5a1dac3e78022b7c835a.tar.gz
samba-089d8c544fb694cc38de5a1dac3e78022b7c835a.tar.bz2
samba-089d8c544fb694cc38de5a1dac3e78022b7c835a.zip
added more complete C99 snprintf test
(This used to be commit 4d7565342d5b53dd038bf25dd6c6afc7132ba2aa)
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in9
1 files changed, 7 insertions, 2 deletions
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"); }
],