summaryrefslogtreecommitdiffstats
path: root/src/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-30 09:51:49 +0000
committerRoy Marples <roy@marples.name>2020-05-30 09:51:49 +0000
commit393d56401a826b2ff50d0f694c6f930413605522 (patch)
treeb6e6bd7472112985ee6b2e76e8e750e40502bd29 /src/if.c
parent2b1d94c0a789448b59e177b7e8842cff6cab7e0a (diff)
downloaddhcpcd-393d56401a826b2ff50d0f694c6f930413605522.tar.xz
Fix some clang analyzer issues
Diffstat (limited to 'src/if.c')
-rw-r--r--src/if.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/if.c b/src/if.c
index 69e9ccb4..acf8dcac 100644
--- a/src/if.c
+++ b/src/if.c
@@ -686,10 +686,15 @@ if_nametospec(const char *ifname, struct if_spec *spec)
errno = e;
return -1;
}
- *ep-- = '\0';
+ *ep = '\0';
+#ifdef __sun
+ ep--;
+#endif
} else {
spec->lun = -1;
+#ifdef __sun
ep = spec->drvname + strlen(spec->drvname) - 1;
+#endif
}
strlcpy(spec->devname, spec->drvname, sizeof(spec->devname));