Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Single character label names are not parsed #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ parse_labels(char *input, PrometheusParseCtx *ctx)
size_t namelen;
size_t valuelen;

count = sscanf(input + i, "%c%1023[a-zA-Z0-9_]=%n",
&labelname[0], &labelname[1], &value_idx);
count = sscanf(input + i, "%1024[a-zA-Z0-9_]=%n",
&labelname[0], &value_idx);

if (count != 2)
if (count != 1)
{
fail("Unexpected number of input items assigned: %d\n", count);
}
Expand Down