]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 13 Nov 1998 19:38:37 +0000 (19:38 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 13 Nov 1998 19:38:37 +0000 (19:38 +0000)
* stdio-common/vfscanf.c: Don't return -1 in case of an invalid
format, jsut stop.

ChangeLog
stdio-common/tstdiomisc.c
stdio-common/vfscanf.c

index 3cfe7f05116e08be5901022857bf841683dc60cb..35d92d3b1486224995869f18dabff202ca6d4591 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1998-11-13  Ulrich Drepper  <drepper@cygnus.com>
 
+       * stdio-common/vfscanf.c: Don't return -1 in case of an invalid
+       format, jsut stop.
+
        * version.h (VERSION): Bump to 2.0.102.
 
        * stdio-common/tstdiomisc.c (t2): Update test case for last scanf
index e99457f5104efc5bd9dad81ca92ea54ae7e2a658..1affac5b5115d7df292d4c635f6cbb4d836a296d 100644 (file)
@@ -21,17 +21,24 @@ t2 (void)
   VAR = -1; \
   retval = sscanf (INPUT, FORMAT, &VAR); \
   printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \
-         INPUT, FORMAT, retval, VAR); \
+         INPUT, FORMAT, retval, (long int) VAR); \
   result |= retval != EXP_RES || VAR != EXP_VAL
 
   SCAN ("12345", "%ld", N, 1, 12345);
-  SCAN ("12345", "%llllld", N, -1, -1);
-  SCAN ("12345", "%LLLLLd", N, -1, -1);
+  SCAN ("12345", "%llllld", N, 0, -1);
+  SCAN ("12345", "%LLLLLd", N, 0, -1);
   SCAN ("test ", "%*s%n",  n, 0, 4);
-  SCAN ("test ", "%2*s%n",  n, -1, -1);
-  SCAN ("12 ",   "%l2d",  n, -1, -1);
+  SCAN ("test ", "%2*s%n",  n, 0, -1);
+  SCAN ("12 ",   "%l2d",  n, 0, -1);
   SCAN ("12 ",   "%2ld",  N, 1, 12);
 
+  n = -1;
+  N = -1;
+  retval = sscanf ("1 1", "%d %Z", &n, &N);
+  printf ("sscanf (\"1 1\", \"%%d %%Z\", &n, &N) => %d, n = %d, N = %ld\n", \
+         retval, n, N); \
+  result |= retval != 1 || n != 1 || N != -1;
+
   return result;
 }
 
index d2302dd9a2dcef02e49185058690f901667a9d67..1b6dc6537dbb9ce2a844cbb1d16262f37c403243 100644 (file)
                          __libc_cleanup_end (0);                             \
                          return EOF;                                         \
                        } while (0)
-# define fmt_error()   do {                                                  \
-                         _IO_funlockfile (s);                                \
-                         __libc_cleanup_end (0);                             \
-                         return EOF;                                         \
-                       } while (0)
 # define ARGCHECK(s, format)                                                 \
   do                                                                         \
     {                                                                        \
                          __set_errno (ENOMEM);                               \
                          return EOF;                                         \
                        } while (0)
-# define fmt_error()   do {                                                  \
-                         funlockfile (s);                                    \
-                         return EOF;                                         \
-                       } while (0)
 # define ARGCHECK(s, format)                                                 \
   do                                                                         \
     {                                                                        \
@@ -1259,7 +1250,7 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
 
        default:
          /* If this is an unknown format character punt.  */
-         fmt_error ();
+         conv_error ();
        }
     }