Skip to content
Snippets Groups Projects
Commit 3fe07807 authored by Niels Möller's avatar Niels Möller
Browse files

(sexp_vformat): Handle %( and %).

Rev: src/nettle/sexp-format.c:1.8
Rev: src/nettle/sexp.h:1.14
parent 27889a95
No related branches found
No related tags found
No related merge requests found
......@@ -146,6 +146,14 @@ sexp_vformat(struct nettle_buffer *buffer, const char *format, va_list args)
default:
abort();
case '(':
case ')':
/* Allow unbalanced parenthesis */
if (buffer && !NETTLE_BUFFER_PUTC(buffer, format[-1]))
return 0;
done++;
break;
case 's':
{
const char *s;
......
......@@ -153,14 +153,15 @@ struct nettle_buffer;
* subexpression. Represented as unsigned length, const uint8_t
* *data.
*
* %(, %) Allows insertion of unbalanced parenthesis.
*
* Modifiers:
*
* %0 For %s, %t and %l, says that there's no length argument,
* instead the string is NUL-terminated, and there's only one
* const uint8_t * argument.
*
* FIXME: Allow "%(" for unbalanced parenthesis. */
*/
unsigned
sexp_format(struct nettle_buffer *buffer,
const char *format, ...);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment