fix for format string signess
Costa Tsaousis (ktsaou) committed
Jun 17, 2016 at 01:34 UTC
b9be2a4396622b1621f340822921f5101529c9d0
8 files changed
+23
-23
src/proc_net_snmp.c
+3
-3
@@ -60,7 +60,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
60
61
words = procfile_linewords(ff, l);
62
if(words < 20) {
63
- error("Cannot read /proc/net/snmp Ip line. Expected 20 params, read %d.", words);
63
+ error("Cannot read /proc/net/snmp Ip line. Expected 20 params, read %u.", words);
64
continue;
65
}
66
@@ -193,7 +193,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
193
194
words = procfile_linewords(ff, l);
195
if(words < 15) {
196
- error("Cannot read /proc/net/snmp Tcp line. Expected 15 params, read %d.", words);
196
+ error("Cannot read /proc/net/snmp Tcp line. Expected 15 params, read %u.", words);
197
continue;
198
}
199
@@ -306,7 +306,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
306
307
words = procfile_linewords(ff, l);
308
if(words < 7) {
309
- error("Cannot read /proc/net/snmp Udp line. Expected 7 params, read %d.", words);
309
+ error("Cannot read /proc/net/snmp Udp line. Expected 7 params, read %u.", words);
310
continue;
311
}
312
src/proc_net_snmp6.c
+1
-1
@@ -361,7 +361,7 @@ int do_proc_net_snmp6(int update_every, unsigned long long dt) {
361
for(l = 0; l < lines ;l++) {
362
words = procfile_linewords(ff, l);
363
if(words < 2) {
364
- if(words) error("Cannot read /proc/net/snmp6 line %d. Expected 2 params, read %d.", l, words);
364
+ if(words) error("Cannot read /proc/net/snmp6 line %u. Expected 2 params, read %u.", l, words);
365
continue;
366
}
367
src/proc_net_stat_conntrack.c
+1
-1
@@ -48,7 +48,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
48
for(l = 1; l < lines ;l++) {
49
words = procfile_linewords(ff, l);
50
if(words < 17) {
51
- if(words) error("Cannot read /proc/net/stat/nf_conntrack line. Expected 17 params, read %d.", words);
51
+ if(words) error("Cannot read /proc/net/stat/nf_conntrack line. Expected 17 params, read %u.", words);
52
continue;
53
}
54
src/proc_stat.c
+1
-1
@@ -48,7 +48,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
48
if(strncmp(procfile_lineword(ff, l, 0), "cpu", 3) == 0) {
49
words = procfile_linewords(ff, l);
50
if(words < 9) {
51
- error("Cannot read /proc/stat cpu line. Expected 9 params, read %d.", words);
51
+ error("Cannot read /proc/stat cpu line. Expected 9 params, read %u.", words);
52
continue;
53
}
54
src/proc_vmstat.c
+1
-1
@@ -321,7 +321,7 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
321
for(l = 0; l < lines ;l++) {
322
words = procfile_linewords(ff, l);
323
if(words < 2) {
324
- if(words) error("Cannot read /proc/vmstat line %d. Expected 2 params, read %d.", l, words);
324
+ if(words) error("Cannot read /proc/vmstat line %d. Expected 2 params, read %u.", l, words);
325
continue;
326
}
327
src/rrd.c
+1
-1
@@ -876,7 +876,7 @@ unsigned long long rrdset_done(RRDSET *st)
876
877
// check if we will re-write the entire data set
878
if(unlikely(usecdiff(&st->last_collected_time, &st->last_updated) > st->update_every * st->entries * 1000000ULL)) {
879
- info("%s: too old data (last updated at %zu.%zu, last collected at %zu.%zu). Reseting it. Will not store the next entry.", st->name, st->last_updated.tv_sec, st->last_updated.tv_usec, st->last_collected_time.tv_sec, st->last_collected_time.tv_usec);
879
+ info("%s: too old data (last updated at %ld.%ld, last collected at %ld.%ld). Reseting it. Will not store the next entry.", st->name, st->last_updated.tv_sec, st->last_updated.tv_usec, st->last_collected_time.tv_sec, st->last_collected_time.tv_usec);
880
rrdset_reset(st);
881
882
st->usec_since_last_update = st->update_every * 1000000ULL;
src/rrd2json.c
+14
-14
@@ -32,8 +32,8 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
32
"\t\t\t\"data_url\": \"/api/v1/data?chart=%s\",\n"
33
"\t\t\t\"chart_type\": \"%s\",\n"
34
"\t\t\t\"duration\": %ld,\n"
35
- "\t\t\t\"first_entry\": %lu,\n"
36
- "\t\t\t\"last_entry\": %lu,\n"
35
+ "\t\t\t\"first_entry\": %ld,\n"
36
+ "\t\t\t\"last_entry\": %ld,\n"
37
"\t\t\t\"update_every\": %d,\n"
38
"\t\t\t\"dimensions\": {\n"
39
, st->id
@@ -132,12 +132,12 @@ unsigned long rrd_stats_one_json(RRDSET *st, char *options, BUFFER *wb)
132
"\t\t\t\"units\": \"%s\",\n"
133
"\t\t\t\"url\": \"/data/%s/%s\",\n"
134
"\t\t\t\"chart_type\": \"%s\",\n"
135
- "\t\t\t\"counter\": %ld,\n"
135
+ "\t\t\t\"counter\": %lu,\n"
136
"\t\t\t\"entries\": %ld,\n"
137
- "\t\t\t\"first_entry_t\": %lu,\n"
138
- "\t\t\t\"last_entry\": %ld,\n"
139
- "\t\t\t\"last_entry_t\": %lu,\n"
140
- "\t\t\t\"last_entry_secs_ago\": %lu,\n"
137
+ "\t\t\t\"first_entry_t\": %ld,\n"
138
+ "\t\t\t\"last_entry\": %lu,\n"
139
+ "\t\t\t\"last_entry_t\": %ld,\n"
140
+ "\t\t\t\"last_entry_secs_ago\": %ld,\n"
141
"\t\t\t\"update_every\": %d,\n"
142
"\t\t\t\"isdetail\": %d,\n"
143
"\t\t\t\"usec_since_last_update\": %llu,\n"
@@ -184,7 +184,7 @@ unsigned long rrd_stats_one_json(RRDSET *st, char *options, BUFFER *wb)
184
"\t\t\t\t\t\"algorithm\": \"%s\",\n"
185
"\t\t\t\t\t\"multiplier\": %ld,\n"
186
"\t\t\t\t\t\"divisor\": %ld,\n"
187
- "\t\t\t\t\t\"last_entry_t\": %lu,\n"
187
+ "\t\t\t\t\t\"last_entry_t\": %ld,\n"
188
"\t\t\t\t\t\"collected_value\": " COLLECTED_NUMBER_FORMAT ",\n"
189
"\t\t\t\t\t\"calculated_value\": " CALCULATED_NUMBER_FORMAT ",\n"
190
"\t\t\t\t\t\"last_collected_value\": " COLLECTED_NUMBER_FORMAT ",\n"
@@ -1429,7 +1429,7 @@ RRDR *rrd2rrdr(RRDSET *st, long points, long long after, long long before, int g
1429
if(unlikely(slot < 0)) slot = st->entries - 1;
1430
if(unlikely(slot == stop_at_slot)) stop_now = counter;
1431
1432
- if(unlikely(debug)) debug(D_RRD_STATS, "ROW %s slot: %ld, entries_counter: %ld, group_count: %ld, added: %ld, now: %lu, %s %s"
1432
+ if(unlikely(debug)) debug(D_RRD_STATS, "ROW %s slot: %ld, entries_counter: %ld, group_count: %ld, added: %ld, now: %ld, %s %s"
1433
, st->id
1434
, slot
1435
, counter
@@ -1822,7 +1822,7 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
1822
// checks for debugging
1823
1824
if(st->debug) {
1825
- debug(D_RRD_STATS, "%s first_entry_t = %lu, last_entry_t = %lu, duration = %lu, after = %lu, before = %lu, duration = %lu, entries_to_show = %lu, group = %lu"
1825
+ debug(D_RRD_STATS, "%s first_entry_t = %ld, last_entry_t = %ld, duration = %ld, after = %ld, before = %ld, duration = %ld, entries_to_show = %ld, group = %ld"
1826
, st->id
1827
, rrdset_first_entry_t(st)
1828
, rrdset_last_entry_t(st)
@@ -1835,10 +1835,10 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
1835
);
1836
1837
if(before < after)
1838
- debug(D_RRD_STATS, "WARNING: %s The newest value in the database (%lu) is earlier than the oldest (%lu)", st->name, before, after);
1838
+ debug(D_RRD_STATS, "WARNING: %s The newest value in the database (%ld) is earlier than the oldest (%ld)", st->name, before, after);
1839
1840
if((before - after) > st->entries * st->update_every)
1841
- debug(D_RRD_STATS, "WARNING: %s The time difference between the oldest and the newest entries (%lu) is higher than the capacity of the database (%lu)", st->name, before - after, st->entries * st->update_every);
1841
+ debug(D_RRD_STATS, "WARNING: %s The time difference between the oldest and the newest entries (%ld) is higher than the capacity of the database (%ld)", st->name, before - after, st->entries * st->update_every);
1842
}
1843
1844
@@ -1934,7 +1934,7 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
1934
1935
int print_this = 0;
1936
1937
- if(st->debug) debug(D_RRD_STATS, "%s t = %ld, count = %ld, group_count = %ld, printed = %ld, now = %lu, %s %s"
1937
+ if(st->debug) debug(D_RRD_STATS, "%s t = %ld, count = %ld, group_count = %ld, printed = %ld, now = %ld, %s %s"
1938
, st->id
1939
, t
1940
, count + 1
@@ -2070,7 +2070,7 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
2070
2071
} // max_loop
2072
2073
- debug(D_RRD_STATS, "RRD_STATS_JSON: %s total %ld bytes", st->name, wb->len);
2073
+ debug(D_RRD_STATS, "RRD_STATS_JSON: %s total %lu bytes", st->name, wb->len);
2074
2075
pthread_rwlock_unlock(&st->rwlock);
2076
return last_timestamp;
src/sys_fs_cgroup.c
+1
-1
@@ -252,7 +252,7 @@ void cgroup_read_cpuacct_usage(struct cpuacct_usage *ca) {
252
if(!ff) return;
253
254
if(procfile_lines(ff) < 1) {
255
- error("File '%s' should have 1+ lines but has %d.", ca->filename, procfile_lines(ff));
255
+ error("File '%s' should have 1+ lines but has %u.", ca->filename, procfile_lines(ff));
256
return;
257
}
258