summaryrefslogtreecommitdiff
path: root/sexp-format.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2002-11-10 14:36:54 +0100
committerNiels Möller <nisse@lysator.liu.se>2002-11-10 14:36:54 +0100
commita8ff180596b0f16837bc08cf493c0f9224c6233f (patch)
tree8195696c4526e6dc290c0cad29d5b7162123a369 /sexp-format.c
parent75689999a9d7ee196d597b56373e2ccfcf87ce45 (diff)
downloadnettle-a8ff180596b0f16837bc08cf493c0f9224c6233f.tar.gz
(sexp_vformat): Abort if format string contains
unhandled characters. Rev: src/nettle/sexp-format.c:1.3
Diffstat (limited to 'sexp-format.c')
-rw-r--r--sexp-format.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sexp-format.c b/sexp-format.c
index 22b7bc4a..d445f034 100644
--- a/sexp-format.c
+++ b/sexp-format.c
@@ -1,4 +1,4 @@
-/* sexp-output.c
+/* sexp-format.c
*
* Writing s-expressions.
*/
@@ -101,6 +101,9 @@ sexp_vformat(struct nettle_buffer *buffer, const char *format, va_list args)
for (;;)
switch (*format++)
{
+ default:
+ abort();
+
case '\0':
assert(!nesting);
@@ -126,6 +129,9 @@ sexp_vformat(struct nettle_buffer *buffer, const char *format, va_list args)
case '%':
switch (*format++)
{
+ default:
+ abort();
+
case 'z':
{
const char *s = va_arg(args, const char *);
@@ -242,8 +248,6 @@ sexp_vformat(struct nettle_buffer *buffer, const char *format, va_list args)
#endif /* ! HAVE_LIBGMP */
break;
}
- default:
- abort();
}
}
}