]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Remove ambiguity between %b format modifiers
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Dec 2015 16:26:29 +0000 (16:26 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Dec 2015 16:26:29 +0000 (16:26 +0000)
clang-plugin/printf_check.cc
src/libserver/cfg_rcl.c
src/libutil/printf.c
src/libutil/printf.h

index 6fd49c439b16f3e80fc3bfe105bb02e73a33da49..f27881e9f9e5715fe38f523baa61086545efc653 100644 (file)
@@ -190,7 +190,7 @@ namespace rspamd {
                        case 'D':
                                return llvm::make_unique<PrintfArgChecker> (int32_arg_handler,
                                                this->pcontext, this->ci);
-                       case 'b':
+                       case 'B':
                                return llvm::make_unique<PrintfArgChecker> (gboolean_arg_handler,
                                                this->pcontext, this->ci);
                        case 'T':
@@ -372,7 +372,7 @@ namespace rspamd {
 
                        format_specs = {
                                        's', 'd', 'l', 'L', 'v', 'V', 'f', 'F', 'g', 'G',
-                                       'T', 'z', 'D', 'c', 'p', 'P', 'e', 'b'
+                                       'T', 'z', 'D', 'c', 'p', 'P', 'e', 'B'
                        };
                };
 
index 014a441838f8fee3636583058f81b689dc7e5aa9..7ddc14f93dbad850a083007e7ee62cfe5784869a 100644 (file)
@@ -2030,7 +2030,7 @@ rspamd_rcl_parse_struct_string (rspamd_mempool_t *pool,
                break;
        case UCL_BOOLEAN:
                *target = rspamd_mempool_alloc (pool, num_str_len);
-               rspamd_snprintf (*target, num_str_len, "%b", (gboolean)obj->value.iv);
+               rspamd_snprintf (*target, num_str_len, "%B", (gboolean)obj->value.iv);
                break;
        default:
                g_set_error (err,
@@ -2378,7 +2378,7 @@ rspamd_rcl_parse_struct_string_list (rspamd_mempool_t *pool,
                        break;
                case UCL_BOOLEAN:
                        val = rspamd_mempool_alloc (pool, num_str_len);
-                       rspamd_snprintf (val, num_str_len, "%b", (gboolean)cur->value.iv);
+                       rspamd_snprintf (val, num_str_len, "%B", (gboolean)cur->value.iv);
                        break;
                default:
                        g_set_error (err,
index 047532dd24dafb3be521a1ab19e1f0c2aab22693..34638dbf656ff8228d42d5abdb08f5f684ccd7dd 100644 (file)
@@ -738,7 +738,7 @@ rspamd_vprintf_common (rspamd_printf_append_func func,
 
                                continue;
 
-                       case 'b':
+                       case 'B':
                                bv = (gboolean) va_arg (args, double);
                                RSPAMD_PRINTF_APPEND (bv ? "true" : "false", bv ? 4 : 5);
 
index f2c46ffc9c837c6d2c42e444bef82c37e6fef052..95d344bee2c6f01ad641d88e20dbff23b572ae16 100644 (file)
@@ -41,7 +41,7 @@
  *     %[0][width][.width]F        long double
  *     %[0][width][.width]g        double
  *     %[0][width][.width]G        long double
- *     %b                          boolean (true or false)
+ *     %B                          boolean (true or false)
  *     %P                                                  pid_t
  *     %r                                          rlim_t
  *     %p                                                  void *