mirror of
https://github.com/rfc1036/whois.git
synced 2026-05-03 06:51:09 +00:00
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:
parent
4808ec3bd8
commit
298f2080fe
4
whois.c
4
whois.c
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user