const char *pch;
if ((pch = strchr(digits, ch)) != NULL) {
- u_int new = *tp * 10 + (pch - digits);
+ u_int new = *tp * 10 + (u_int)(pch - digits);
if (saw_digit && *tp == 0) {
return 0;
if (new > 255) {
return 0;
}
- *tp = new;
+ *tp = (u_char)new;
if (!saw_digit) {
if (++octets > 4) {
return 0;
* Since some memmove()'s erroneously fail to handle
* overlapping regions, we'll do the shift by hand.
*/
- const int n = tp - colonp;
+ const long n = tp - colonp;
int i;
if (tp == endp) {