Skip to content

Commit

Permalink
decode_prometheus_remote_write: Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Apr 26, 2024
1 parent 6fea0b2 commit 443623d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cmt_decode_prometheus_remote_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ static struct cmt_map_label *create_map_label(char *caption, size_t length)
struct cmt_map_label *map_label;

map_label = calloc(1, sizeof(struct cmt_map_label));
if (!map_label) {
return NULL;
}

if (map_label != NULL) {
if (caption != NULL) {
Expand Down Expand Up @@ -468,9 +471,7 @@ static int decode_histogram_time_series(struct cmt *cmt,

result = CMT_DECODE_PROMETHEUS_REMOTE_WRITE_SUCCESS;

for (index = 0 ;
result == 0 &&
index < hist_count ; index++) {
for (index = 0; result == 0 && index < hist_count; index++) {
histogram = ts->histograms[index];
result = decode_histogram_points(cmt, map,
ts->n_histograms,
Expand Down

0 comments on commit 443623d

Please sign in to comment.