]> git.saurik.com Git - apple/libc.git/blobdiff - stdio/FreeBSD/vfscanf.c
Libc-1439.100.3.tar.gz
[apple/libc.git] / stdio / FreeBSD / vfscanf.c
index a3f9f3e871a4e0eab9ba7d1e235fc2bf8d6884c4..eca276601f75f301aed8ca83ba2107095c6ea27b 100644 (file)
@@ -30,6 +30,9 @@
  * SUCH DAMAGE.
  */
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wcomma"
+
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)vfscanf.c  8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
@@ -156,7 +159,7 @@ __svfscanf_l(FILE * __restrict fp, locale_t loc, const char * __restrict fmt0, v
        int mb_cur_max;
 
        /* `basefix' is used to avoid `if' tests in the integer scanner */
-       static short basefix[17] =
+       static const short basefix[17] =
                { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
 
        NORMALIZE_LOCALE(loc);
@@ -326,8 +329,10 @@ literal:
 
                case 'n':
                {
+                       if (flags & SUPPRESS)   /* ??? */
+                               continue;
                        void *ptr = va_arg(ap, void *);
-                       if ((ptr == NULL) || (flags & SUPPRESS))        /* ??? */
+                       if (ptr == NULL)
                                continue;
                        else if (flags & SHORTSHORT)
                                *(char *)ptr = nread;
@@ -1192,3 +1197,4 @@ parsedone:
        return (commit - b);
 }
 #endif
+#pragma clang diagnostic push