Skip to content

Commit

Permalink
nvs: fix fscanf return warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Jun 15, 2017
1 parent 79f8f71 commit 1473a8f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nvsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ int nvs_query_int(int nvs_id, const char* field, int showerr)
fp = popen(command, "r");
if (fp) {
int intval = -1;
if (!showerr)
fscanf(fp, "%d", &intval);
else {
if (!showerr) {
int b = fscanf(fp, "%d", &intval);
if (!b) {
pclose(fp);
return -1;
}
} else {
char msg[512] = { 0 };
char buf[64] = { 0 };
ssize_t bytes, len=0, maxlen=sizeof(msg)-1;
Expand Down

0 comments on commit 1473a8f

Please sign in to comment.