diff options
author | Mariusz Zaborski <oshogbo@FreeBSD.org> | 2017-05-22 20:11:40 +0000 |
---|---|---|
committer | Mariusz Zaborski <oshogbo@FreeBSD.org> | 2017-05-22 20:11:40 +0000 |
commit | 490b79db021cc754619a9103eb1c733564365c0e (patch) | |
tree | 8be704b869bdb226d7f098834d12be5e3f9af687 | |
parent | 33c6ba0c654e36ad6386af48f475a24d52181203 (diff) |
Notes
-rw-r--r-- | sys/boot/common/dev_net.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/boot/common/dev_net.c b/sys/boot/common/dev_net.c index b7127163c77e5..b209185f0709b 100644 --- a/sys/boot/common/dev_net.c +++ b/sys/boot/common/dev_net.c @@ -387,16 +387,14 @@ net_print(int verbose) uint32_t net_parse_rootpath() { - int i; n_long addr = INADDR_NONE; + char *ptr; - for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) - if (rootpath[i] == ':') - break; - if (i && i != FNAME_SIZE && rootpath[i] == ':') { - rootpath[i++] = '\0'; - addr = inet_addr(&rootpath[0]); - bcopy(&rootpath[i], rootpath, strlen(&rootpath[i])+1); + ptr = rootpath; + (void)strsep(&ptr, ":"); + if (ptr != NULL) { + addr = inet_addr(rootpath); + bcopy(ptr, rootpath, strlen(ptr) + 1); } return (addr); |