Use os_snprintf() instead of snprintf()
This commit is contained in:
parent
1add3c3387
commit
3fd0b8f196
1 changed files with 16 additions and 16 deletions
|
@ -1269,32 +1269,32 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
|
||||||
bss = results->res[i];
|
bss = results->res[i];
|
||||||
pos = buf;
|
pos = buf;
|
||||||
end = buf + buflen;
|
end = buf + buflen;
|
||||||
ret = snprintf(pos, end - pos,
|
ret = os_snprintf(pos, end - pos,
|
||||||
"bssid=" MACSTR "\n"
|
"bssid=" MACSTR "\n"
|
||||||
"freq=%d\n"
|
"freq=%d\n"
|
||||||
"beacon_int=%d\n"
|
"beacon_int=%d\n"
|
||||||
"capabilities=0x%04x\n"
|
"capabilities=0x%04x\n"
|
||||||
"qual=%d\n"
|
"qual=%d\n"
|
||||||
"noise=%d\n"
|
"noise=%d\n"
|
||||||
"level=%d\n"
|
"level=%d\n"
|
||||||
"tsf=%016llu\n"
|
"tsf=%016llu\n"
|
||||||
"ie=",
|
"ie=",
|
||||||
MAC2STR(bss->bssid), bss->freq, bss->beacon_int,
|
MAC2STR(bss->bssid), bss->freq, bss->beacon_int,
|
||||||
bss->caps, bss->qual, bss->noise, bss->level,
|
bss->caps, bss->qual, bss->noise, bss->level,
|
||||||
(unsigned long long) bss->tsf);
|
(unsigned long long) bss->tsf);
|
||||||
if (ret < 0 || ret >= end - pos)
|
if (ret < 0 || ret >= end - pos)
|
||||||
return pos - buf;
|
return pos - buf;
|
||||||
pos += ret;
|
pos += ret;
|
||||||
|
|
||||||
ie = (const u8 *) (bss + 1);
|
ie = (const u8 *) (bss + 1);
|
||||||
for (i = 0; i < bss->ie_len; i++) {
|
for (i = 0; i < bss->ie_len; i++) {
|
||||||
ret = snprintf(pos, end - pos, "%02x", *ie++);
|
ret = os_snprintf(pos, end - pos, "%02x", *ie++);
|
||||||
if (ret < 0 || ret >= end - pos)
|
if (ret < 0 || ret >= end - pos)
|
||||||
return pos - buf;
|
return pos - buf;
|
||||||
pos += ret;
|
pos += ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = snprintf(pos, end - pos, "\n");
|
ret = os_snprintf(pos, end - pos, "\n");
|
||||||
if (ret < 0 || ret >= end - pos)
|
if (ret < 0 || ret >= end - pos)
|
||||||
return pos - buf;
|
return pos - buf;
|
||||||
pos += ret;
|
pos += ret;
|
||||||
|
@ -1323,7 +1323,7 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
|
||||||
pos += ret;
|
pos += ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = snprintf(pos, end - pos, "\n");
|
ret = os_snprintf(pos, end - pos, "\n");
|
||||||
if (ret < 0 || ret >= end - pos)
|
if (ret < 0 || ret >= end - pos)
|
||||||
return pos - buf;
|
return pos - buf;
|
||||||
pos += ret;
|
pos += ret;
|
||||||
|
|
Loading…
Reference in a new issue