]> granicus.if.org Git - php/commitdiff
MFB snprintf test
authorSascha Schumann <sas@php.net>
Sat, 28 Jun 2003 12:29:43 +0000 (12:29 +0000)
committerSascha Schumann <sas@php.net>
Sat, 28 Jun 2003 12:29:43 +0000 (12:29 +0000)
acinclude.m4

index ae39f130cbb993c2724e2be441151df307589175..0949e4b43730aee35df359b5ee442896c659b770 100644 (file)
@@ -1119,7 +1119,9 @@ main() {
        int res = 0;
        res = res || (snprintf(buf, 2, "marcus") != 6); 
        res = res || (buf[1] != '\0');
-       res = res || (snprintf(buf, 0, "boerger") != 7);
+       /* Implementations may consider this as an encoding error */
+       snprintf(buf, 0, "boerger");
+       /* However, they MUST ignore the pointer */
        res = res || (buf[0] != 'm');
        res = res || (snprintf(NULL, 0, "boerger") != 7);
        res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8);