diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-08-08 14:05:58 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-08-13 11:00:28 +0200 |
commit | 495e12aeadb02bfda8621984ff0a4e07e1fcd89f (patch) | |
tree | 9b7083d3f87fba57dd7c7339e5cec2d6e2be4cdf /src/libstrongswan | |
parent | c6c39c783bd713fe2c159be7445a82f8b8c9c3e5 (diff) | |
download | strongswan-495e12aeadb02bfda8621984ff0a4e07e1fcd89f.tar.bz2 strongswan-495e12aeadb02bfda8621984ff0a4e07e1fcd89f.tar.xz |
Add support for '+' in custom format specifiers
Diffstat (limited to 'src/libstrongswan')
-rw-r--r-- | src/libstrongswan/printf_hook.c | 2 | ||||
-rw-r--r-- | src/libstrongswan/printf_hook.h | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libstrongswan/printf_hook.c b/src/libstrongswan/printf_hook.c index 2ae804380..8bd513c05 100644 --- a/src/libstrongswan/printf_hook.c +++ b/src/libstrongswan/printf_hook.c @@ -93,6 +93,7 @@ static int custom_print(FILE *stream, const struct printf_info *info, }; spec.hash = info->alt; + spec.plus = info->showsign; spec.minus = info->left; spec.width = info->width; @@ -164,6 +165,7 @@ static int custom_fmt_cb(Vstr_base *base, size_t pos, Vstr_fmt_spec *fmt_spec) } spec.hash = fmt_spec->fmt_hash; + spec.plus = fmt_spec->fmt_plus; spec.minus = fmt_spec->fmt_minus; spec.width = fmt_spec->fmt_field_width; diff --git a/src/libstrongswan/printf_hook.h b/src/libstrongswan/printf_hook.h index 93026cc34..96e5a19af 100644 --- a/src/libstrongswan/printf_hook.h +++ b/src/libstrongswan/printf_hook.h @@ -163,6 +163,11 @@ struct printf_hook_spec_t { int minus; /** + * TRUE if a '+' was used in the format specifier + */ + int plus; + + /** * The width as given in the format specifier. */ int width; |