Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ccan/ciniparser: fix truncation warning #116

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
4 changes: 2 additions & 2 deletions ccan/ciniparser/ciniparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ dictionary *ciniparser_load(const char *ininame)
char line[ASCIILINESZ+1];
char section[ASCIILINESZ+1];
char key[ASCIILINESZ+1];
char tmp[ASCIILINESZ+1];
char tmp[2*ASCIILINESZ+2];
char val[ASCIILINESZ+1];
int last = 0, len, lineno = 0, errs = 0;
dictionary *dict;
Expand Down Expand Up @@ -439,7 +439,7 @@ dictionary *ciniparser_load(const char *ininame)
break;

case LINE_VALUE:
snprintf(tmp, ASCIILINESZ + 1, "%s:%s", section, key);
snprintf(tmp, sizeof(tmp), "%s:%s", section, key);
errs = dictionary_set(dict, tmp, val);
break;

Expand Down