]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: Add a missing break in a switch statement
authorChristopher Faulet <cfaulet@haproxy.com>
Sat, 28 Sep 2019 08:37:31 +0000 (10:37 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Sat, 28 Sep 2019 08:41:09 +0000 (10:41 +0200)
A break is missing in the switch statement in the function
stats_emit_json_data_field(). This bug was introduced in the commit 88a0db28a
("MINOR: stats: Add the support of float fields in stats").

This patch fixes the issue #302 and #303. It must be backported to 2.0.

src/stats.c

index f280e5a7178ed723ea37df00aa13836b8dbe10ae..5a0d4e1a64d2e1d0be5b4cf7be2c7766655681ae 100644 (file)
@@ -391,6 +391,7 @@ int stats_emit_json_data_field(struct buffer *out, const struct field *f)
                       type = "\"u64\"";
                       snprintf(buf, sizeof(buf), "%llu",
                                (unsigned long long) f->u.u64);
+                      break;
        case FF_FLT:   type = "\"flt\"";
                       snprintf(buf, sizeof(buf), "%f", f->u.flt);
                       break;