strtol() returns signed long int

Assiging strol() return value to unsigned int makes subsequent
comparison to < 0 pointless.

Signed-off-by: Petr Písař <ppisar@redhat.com>
This commit is contained in:
Petr Písař 2013-11-11 17:28:59 +01:00 committed by Marco d'Itri
parent 4808ec3bd8
commit 298f2080fe

View File

@ -1118,7 +1118,7 @@ char *convert_inaddr(const char *s)
{
char *new;
char *endptr;
unsigned int a, b = 0, c = 0;
long int a, b = 0, c = 0;
errno = 0;
@ -1142,7 +1142,7 @@ char *convert_inaddr(const char *s)
}
new = malloc(sizeof("255.255.255.255"));
sprintf(new, "%d.%d.%d.0", c, b, a);
sprintf(new, "%ld.%ld.%ld.0", c, b, a);
return new;
}