X-Git-Url: https://git.saurik.com/apple/libutil.git/blobdiff_plain/e682b5d1d4d4e3ed8ef022839493d1c18b470503..afa5f1bdb11b69ffd6c9171fdade7bf337fa8c06:/trimdomain.c diff --git a/trimdomain.c b/trimdomain.c index 6287e84..3c4c20a 100644 --- a/trimdomain.c +++ b/trimdomain.c @@ -34,6 +34,8 @@ #include #include +void trimdomain(char *_fullhost, size_t _hostsize); + static int isDISP(const char *); /*- @@ -50,7 +52,7 @@ static int isDISP(const char *); * trimdomain("abcde.my.domain:0.0", 8) -> "abcde.my.domain:0.0" */ void -trimdomain(char *fullhost, int hostsize) +trimdomain(char *fullhost, size_t hostsize) { static size_t dlen; static int first = 1; @@ -73,7 +75,7 @@ trimdomain(char *fullhost, int hostsize) return; s = fullhost; - end = s + hostsize + 1; + end = (char *)((uintptr_t)s + hostsize + 1); if ((s = memchr(s, '.', (size_t)(end - s))) != NULL) { if (strncasecmp(s + 1, domain, dlen) == 0) { if (s[dlen + 1] == '\0') {