netstat: avoid returning uninitialized value in p_sockaddr().
In the case the width is less than 0, we are returning an uninitialized value. For practical purposes the return value is ignored but initialize it to avoid trouble. CID: 1341619
This commit is contained in:
parent
2f396d3cc3
commit
cfe3da09e2
@ -417,6 +417,7 @@ p_sockaddr(const char *name, struct sockaddr *sa, struct sockaddr *mask,
|
||||
if (width < 0) {
|
||||
snprintf(buf, sizeof(buf), "{:%s/%%s} ", name);
|
||||
xo_emit(buf, cp);
|
||||
protrusion = 0;
|
||||
} else {
|
||||
if (Wflag != 0 || numeric_addr) {
|
||||
snprintf(buf, sizeof(buf), "{[:%d}{:%s/%%s}{]:} ",
|
||||
|
Loading…
x
Reference in New Issue
Block a user