From: Tobias Brunner Date: Wed, 8 Aug 2012 12:05:58 +0000 (+0200) Subject: Add support for '+' in custom format specifiers X-Git-Tag: 5.0.1~210^2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=495e12aeadb02bfda8621984ff0a4e07e1fcd89f;p=thirdparty%2Fstrongswan.git Add support for '+' in custom format specifiers --- diff --git a/src/libstrongswan/printf_hook.c b/src/libstrongswan/printf_hook.c index 2ae8043801..8bd513c059 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 93026cc34e..96e5a19afe 100644 --- a/src/libstrongswan/printf_hook.h +++ b/src/libstrongswan/printf_hook.h @@ -162,6 +162,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. */