MFC 1.41: fix handling of ssid "-" etc

This commit is contained in:
sam 2007-01-25 17:29:04 +00:00
parent 2d491327e3
commit 5a6ef06c97

View File

@ -1913,9 +1913,10 @@ get_string(const char *val, const char *sep, u_int8_t *buf, int *lenp)
}
len = p - buf;
/* The string "-" is treated as the empty string. */
if (!hexstr && len == 1 && buf[0] == '-')
if (!hexstr && len == 1 && buf[0] == '-') {
len = 0;
if (len < *lenp)
memset(buf, 0, *lenp);
} else if (len < *lenp)
memset(p, 0, *lenp - len);
*lenp = len;
return val;