about summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-11-13 15:05:05 +0000
committerUlrich Drepper <drepper@redhat.com>1998-11-13 15:05:05 +0000
commit47b856a9eac04e1e18d949cc751c397610bba429 (patch)
treeb2e74580a4831b6c2c1bed1fcdc60eb1ef74525c /stdio-common
parentfb3d8ad658464fc8d4728c892ed815c362cd1972 (diff)
downloadglibc-47b856a9eac04e1e18d949cc751c397610bba429.tar.gz
glibc-47b856a9eac04e1e18d949cc751c397610bba429.tar.xz
glibc-47b856a9eac04e1e18d949cc751c397610bba429.zip
	* stdio-common/vfscanf.c: Return EOF for invalid format
	characters.

1998-11-13  Philip Blundell  <philb@gnu.org>

	* sysdeps/arm/fpu/bits/setjmp.h (__JMP_BUF_SP): Correct value.
	Reported by Scott Bambrough.
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/vfscanf.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index ec4a264d65..d2302dd9a2 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -85,6 +85,11 @@
 			  __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									      \
     {									      \
@@ -129,6 +134,10 @@
 			  __set_errno (ENOMEM);				      \
 			  return EOF;					      \
 			} while (0)
+# define fmt_error()	do {						      \
+			  funlockfile (s);				      \
+			  return EOF;					      \
+			} while (0)
 # define ARGCHECK(s, format)						      \
   do									      \
     {									      \
@@ -1247,6 +1256,10 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
 	  number_signed = 0;
 	  read_pointer = 1;
 	  goto number;
+
+	default:
+	  /* If this is an unknown format character punt.  */
+	  fmt_error ();
 	}
     }