Reformat netbiosns.c using astylerc

This commit is contained in:
Dirk Ziegelmeier 2017-09-17 18:05:07 +02:00
parent be5bcc172d
commit 52d65ed1d0

View File

@ -123,8 +123,7 @@ PACK_STRUCT_END
# include "arch/bpstruct.h"
#endif
PACK_STRUCT_BEGIN
struct netbios_resp
{
struct netbios_resp {
struct netbios_hdr resp_hdr;
struct netbios_name_hdr resp_name;
} PACK_STRUCT_STRUCT;
@ -159,10 +158,12 @@ netbiosns_name_decode(char *name_enc, char *name_dec, int name_dec_len)
/* Every two characters of the first level-encoded name
* turn into one character in the decoded name. */
cname = *pname;
if (cname == '\0')
if (cname == '\0') {
break; /* no more characters */
if (cname == '.')
}
if (cname == '.') {
break; /* scope ID follows */
}
if (cname < 'A' || cname > 'Z') {
/* Not legal. */
return -1;
@ -213,10 +214,12 @@ netbiosns_name_encode(char *name_enc, char *name_dec, int name_dec_len)
/* Every two characters of the first level-encoded name
* turn into one character in the decoded name. */
cname = *pname;
if (cname == '\0')
if (cname == '\0') {
break; /* no more characters */
if (cname == '.')
}
if (cname == '.') {
break; /* scope ID follows */
}
if ((cname < 'A' || cname > 'Z') && (cname < '0' || cname > '9')) {
/* Not legal. */
return -1;