Commit a8ff1805 authored by Niels Möller's avatar Niels Möller

(sexp_vformat): Abort if format string contains

unhandled characters.

Rev: src/nettle/sexp-format.c:1.3
parent 75689999
/* 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();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment