summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/net.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/net.c b/net/net.c
index c8b2d9c55e..3d376faa99 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1101,19 +1101,18 @@ IPaddr_t string_to_ip(const char *s)
char *e;
int i;
- if (s == NULL)
- return(0);
+ if (!s)
+ return 0;
- for (addr=0, i=0; i<4; ++i) {
+ for (addr = 0, i = 0; i < 4; ++i) {
ulong val = s ? simple_strtoul(s, &e, 10) : 0;
addr <<= 8;
addr |= (val & 0xFF);
- if (s) {
- s = (*e) ? e+1 : e;
- }
+ if (s)
+ s = *e ? e + 1 : e;
}
- return (htonl(addr));
+ return htonl(addr);
}
void VLAN_to_string(ushort x, char *s)