]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Add support for '+' in custom format specifiers
authorTobias Brunner <tobias@strongswan.org>
Wed, 8 Aug 2012 12:05:58 +0000 (14:05 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 13 Aug 2012 09:00:28 +0000 (11:00 +0200)
src/libstrongswan/printf_hook.c
src/libstrongswan/printf_hook.h

index 2ae8043801d17cf5aaa55c4e74de823ca9203730..8bd513c0591f8731802d058d7c888b968b73dc8d 100644 (file)
@@ -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;
 
index 93026cc34e03cf1f3abf1185c26821520234bace..96e5a19afe3a9824a486d634b50f62ad14ca8b19 100644 (file)
@@ -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.
         */