You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.0 KiB

  1. commit c0104fc33ccf7e843efd37cc033e4c3849a37844
  2. Author: Christopher Faulet <cfaulet@haproxy.com>
  3. Date: Sat Sep 28 10:37:31 2019 +0200
  4. BUG/MINOR: stats: Add a missing break in a switch statement
  5. A break is missing in the switch statement in the function
  6. stats_emit_json_data_field(). This bug was introduced in the commit 88a0db28a
  7. ("MINOR: stats: Add the support of float fields in stats").
  8. This patch fixes the issue #302 and #303. It must be backported to 2.0.
  9. (cherry picked from commit 52c91bb72ccf20e75f2f79da6ebe345cb2a768f4)
  10. Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
  11. diff --git a/src/stats.c b/src/stats.c
  12. index 5819f459..9ec5066f 100644
  13. --- a/src/stats.c
  14. +++ b/src/stats.c
  15. @@ -399,6 +399,7 @@ int stats_emit_json_data_field(struct buffer *out, const struct field *f)
  16. type = "\"u64\"";
  17. snprintf(buf, sizeof(buf), "%llu",
  18. (unsigned long long) f->u.u64);
  19. + break;
  20. case FF_FLT: type = "\"flt\"";
  21. snprintf(buf, sizeof(buf), "%f", f->u.flt);
  22. break;