Change in libosmocore[master]: statsd report: Fix wrong fmt specificier generating wrong stats

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Nov 30 13:22:39 UTC 2020


pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/21393 )

Change subject: statsd report: Fix wrong fmt specificier generating wrong stats
......................................................................

statsd report: Fix wrong fmt specificier generating wrong stats

Fixes: OS#4871
Change-Id: I04aba0f3a4ff6563a4e285b982077184645d1180
---
M src/stats_statsd.c
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved



diff --git a/src/stats_statsd.c b/src/stats_statsd.c
index d449667..99764e6 100644
--- a/src/stats_statsd.c
+++ b/src/stats_statsd.c
@@ -32,6 +32,7 @@
 
 #include <string.h>
 #include <stdint.h>
+#include <inttypes.h>
 #include <errno.h>
 
 #include <osmocom/core/utils.h>
@@ -100,15 +101,15 @@
 
 	if (prefix) {
 		if (name1)
-			fmt = "%1$s.%2$s.%6$u.%3$s:%4$d|%5$s";
+			fmt = "%1$s.%2$s.%6$u.%3$s:%4$" PRId64 "|%5$s";
 		else
-			fmt = "%1$s.%2$0.0s%3$s:%4$d|%5$s";
+			fmt = "%1$s.%2$0.0s%3$s:%4$" PRId64 "|%5$s";
 	} else {
 		prefix = "";
 		if (name1)
-			fmt = "%1$s%2$s.%6$u.%3$s:%4$d|%5$s";
+			fmt = "%1$s%2$s.%6$u.%3$s:%4$" PRId64 "|%5$s";
 		else
-			fmt = "%1$s%2$0.0s%3$s:%4$d|%5$s";
+			fmt = "%1$s%2$0.0s%3$s:%4$" PRId64 "|%5$s";
 	}
 
 	if (srep->agg_enabled) {

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21393
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I04aba0f3a4ff6563a4e285b982077184645d1180
Gerrit-Change-Number: 21393
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201130/5b826140/attachment.htm>


More information about the gerrit-log mailing list