diff options
author | markm <markm@FreeBSD.org> | 2003-10-18 10:04:16 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2003-10-18 10:04:16 +0000 |
commit | 3f45792057cf4f7381e74bec6f437cdb290e1817 (patch) | |
tree | 204484574f03753da73a26a0ec8c893e61e56e98 /lib/libutil/trimdomain.c | |
parent | 4d1565cf183af3ea64b06fbc0cff68b6956350bb (diff) | |
download | FreeBSD-src-3f45792057cf4f7381e74bec6f437cdb290e1817.zip FreeBSD-src-3f45792057cf4f7381e74bec6f437cdb290e1817.tar.gz |
ANSIfy, WARNSify, CONSTify. Bit of style(9)-ify.
Diffstat (limited to 'lib/libutil/trimdomain.c')
-rw-r--r-- | lib/libutil/trimdomain.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libutil/trimdomain.c b/lib/libutil/trimdomain.c index a2cdf19..a7ce8c4 100644 --- a/lib/libutil/trimdomain.c +++ b/lib/libutil/trimdomain.c @@ -75,7 +75,7 @@ trimdomain(char *fullhost, int hostsize) s = fullhost; end = s + hostsize + 1; - for (; (s = memchr(s, '.', end - s)) != NULL; s++) { + for (; (s = memchr(s, '.', (size_t)(end - s))) != NULL; s++) { if (strncasecmp(s + 1, domain, dlen) == 0) { if (s[dlen + 1] == '\0') { /* Found -- lose the domain. */ @@ -83,7 +83,7 @@ trimdomain(char *fullhost, int hostsize) break; } else if (s[dlen + 1] == ':' && isDISP(s + dlen + 2) && - (len = strlen(s + dlen + 1)) < end - s) { + (len = strlen(s + dlen + 1)) < (size_t)(end - s)) { /* Found -- shuffle the DISPLAY back. */ memmove(s, s + dlen + 1, len + 1); break; @@ -98,7 +98,8 @@ trimdomain(char *fullhost, int hostsize) static int isDISP(const char *disp) { - int res, w; + size_t w; + int res; w = strspn(disp, "0123456789"); res = 0; |