Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Baryshkov
nettle
Commits
2039f20a
Commit
2039f20a
authored
Feb 10, 2003
by
Niels Möller
Browse files
* sexp-format.c (sexp_vformat): Allow whitespace in format string.
Rev: src/nettle/sexp-format.c:1.7 Rev: src/nettle/sexp.h:1.13
parent
df200717
Changes
2
Show whitespace changes
Inline
Side-by-side
sexp-format.c
View file @
2039f20a
...
...
@@ -97,7 +97,7 @@ sexp_vformat(struct nettle_buffer *buffer, const char *format, va_list args)
default:
{
const
char
*
start
=
format
-
1
;
unsigned
length
=
1
+
strcspn
(
format
,
"()%"
);
unsigned
length
=
1
+
strcspn
(
format
,
"()%
\t
"
);
unsigned
output_length
=
format_string
(
buffer
,
length
,
start
);
if
(
!
output_length
)
return
0
;
...
...
@@ -107,6 +107,9 @@ sexp_vformat(struct nettle_buffer *buffer, const char *format, va_list args)
break
;
}
case
' '
:
case
'\t'
:
break
;
case
'\0'
:
assert
(
!
nesting
);
...
...
sexp.h
View file @
2039f20a
...
...
@@ -135,7 +135,8 @@ struct nettle_buffer;
* buffer == NULL, just compute length.
*
* Format strings can contained matched parentheses, tokens ("foo" in
* the format string is formatted as "3:foo"), and the following
* the format string is formatted as "3:foo"), whitespace (which
* separates tokens but is otherwise ignored) and the following
* formatting specifiers:
*
* %s String represented as unsigned length, const uint8_t *data.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment