fix -Wformat-truncation warnings
Increase buffer sizes to get rid of e.g.: iwinfo_nl80211.c:797:41: note: 'snprintf' output between 24 and 279 bytes into a destination of size 64 Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
parent
50380db79b
commit
ccaabb4ea4
2 changed files with 7 additions and 7 deletions
|
@ -46,7 +46,7 @@ static char * format_ssid(char *ssid)
|
||||||
|
|
||||||
static char * format_channel(int ch)
|
static char * format_channel(int ch)
|
||||||
{
|
{
|
||||||
static char buf[8];
|
static char buf[16];
|
||||||
|
|
||||||
if (ch <= 0)
|
if (ch <= 0)
|
||||||
snprintf(buf, sizeof(buf), "unknown");
|
snprintf(buf, sizeof(buf), "unknown");
|
||||||
|
@ -70,7 +70,7 @@ static char * format_frequency(int freq)
|
||||||
|
|
||||||
static char * format_txpower(int pwr)
|
static char * format_txpower(int pwr)
|
||||||
{
|
{
|
||||||
static char buf[10];
|
static char buf[16];
|
||||||
|
|
||||||
if (pwr < 0)
|
if (pwr < 0)
|
||||||
snprintf(buf, sizeof(buf), "unknown");
|
snprintf(buf, sizeof(buf), "unknown");
|
||||||
|
@ -82,7 +82,7 @@ static char * format_txpower(int pwr)
|
||||||
|
|
||||||
static char * format_quality(int qual)
|
static char * format_quality(int qual)
|
||||||
{
|
{
|
||||||
static char buf[8];
|
static char buf[16];
|
||||||
|
|
||||||
if (qual < 0)
|
if (qual < 0)
|
||||||
snprintf(buf, sizeof(buf), "unknown");
|
snprintf(buf, sizeof(buf), "unknown");
|
||||||
|
@ -94,7 +94,7 @@ static char * format_quality(int qual)
|
||||||
|
|
||||||
static char * format_quality_max(int qmax)
|
static char * format_quality_max(int qmax)
|
||||||
{
|
{
|
||||||
static char buf[8];
|
static char buf[16];
|
||||||
|
|
||||||
if (qmax < 0)
|
if (qmax < 0)
|
||||||
snprintf(buf, sizeof(buf), "unknown");
|
snprintf(buf, sizeof(buf), "unknown");
|
||||||
|
|
|
@ -240,7 +240,7 @@ static const char *nl80211_phy_path_str(const char *phyname)
|
||||||
int prefix_len = strlen(prefix);
|
int prefix_len = strlen(prefix);
|
||||||
int buf_len, offset;
|
int buf_len, offset;
|
||||||
struct dirent *e;
|
struct dirent *e;
|
||||||
char buf[128], *link;
|
char buf[512], *link;
|
||||||
int phy_idx;
|
int phy_idx;
|
||||||
int seq = 0;
|
int seq = 0;
|
||||||
DIR *d;
|
DIR *d;
|
||||||
|
@ -297,7 +297,7 @@ static const char *nl80211_phy_path_str(const char *phyname)
|
||||||
|
|
||||||
static int nl80211_phy_idx_from_path(const char *path)
|
static int nl80211_phy_idx_from_path(const char *path)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[512];
|
||||||
struct dirent *e;
|
struct dirent *e;
|
||||||
const char *cur_path;
|
const char *cur_path;
|
||||||
int cur_path_len;
|
int cur_path_len;
|
||||||
|
@ -736,7 +736,7 @@ nla_put_failure:
|
||||||
static char * nl80211_phy2ifname(const char *ifname)
|
static char * nl80211_phy2ifname(const char *ifname)
|
||||||
{
|
{
|
||||||
int ifidx = -1, cifidx = -1, phyidx = -1;
|
int ifidx = -1, cifidx = -1, phyidx = -1;
|
||||||
char buffer[64];
|
char buffer[512];
|
||||||
static char nif[IFNAMSIZ] = { 0 };
|
static char nif[IFNAMSIZ] = { 0 };
|
||||||
|
|
||||||
DIR *d;
|
DIR *d;
|
||||||
|
|
Loading…
Add table
Reference in a new issue