mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
apps/netbiosns: Convert to use lwip_isupper instead of open-coded
Also remove additonal (cname == '\0' || cname == '.') check because it's covered by !lwip_isupper(cname) test. Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
58be2b1573
commit
9b638e7c05
@ -245,7 +245,7 @@ netbiosns_name_decode(char *name_enc, char *name_dec, int name_dec_len)
|
|||||||
if (cname == '.') {
|
if (cname == '.') {
|
||||||
break; /* scope ID follows */
|
break; /* scope ID follows */
|
||||||
}
|
}
|
||||||
if (cname < 'A' || cname > 'Z') {
|
if (!lwip_isupper(cname)) {
|
||||||
/* Not legal. */
|
/* Not legal. */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -254,12 +254,7 @@ netbiosns_name_decode(char *name_enc, char *name_dec, int name_dec_len)
|
|||||||
pname++;
|
pname++;
|
||||||
|
|
||||||
cname = *pname;
|
cname = *pname;
|
||||||
if (cname == '\0' || cname == '.') {
|
if (!lwip_isupper(cname)) {
|
||||||
/* No more characters in the name - but we're in
|
|
||||||
* the middle of a pair. Not legal. */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (cname < 'A' || cname > 'Z') {
|
|
||||||
/* Not legal. */
|
/* Not legal. */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user