Browse Source

nvs: fix fscanf return warning

master
Tanguy Pruvot 8 years ago
parent
commit
1473a8fd6f
  1. 10
      nvsettings.cpp

10
nvsettings.cpp

@ -78,9 +78,13 @@ int nvs_query_int(int nvs_id, const char* field, int showerr) @@ -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;

Loading…
Cancel
Save