Skip to content

Commit

Permalink
fixed #3 wrong valid check is_ipv4
Browse files Browse the repository at this point in the history
  • Loading branch information
Joungkyun committed Jul 9, 2016
1 parent f354b39 commit 1591203
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Sat, Jul 09 2016 JoungKyun.Kim <http://oops.og>
- fixed #1 prefix2long integer overflow on 64bit machine
- fixed #2 deprecated valid_ip_address api (00749f1)
use is_ipv4 api in place of valid_ip_address.
- fixed #3 wrong valid check is_ipv4

Thu, Feb 13 2014 JoungKyun.Kim <http://oops.org>
- support native window library and binaries with MinGW
Expand Down
2 changes: 1 addition & 1 deletion ipcalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ IPCALC_API short is_ipv4 (char * addr, char * err) { // {{{

memset (err, 0, 1);
memset (&hints, 0, sizeof (hints));
hints.ai_family = AF_UNSPEC;
hints.ai_family = AF_INET; // only IPv4

if ( (stat = getaddrinfo (addr, NULL, &hints, &r)) != 0 ) {
strcpy (err, gai_strerror (stat));
Expand Down
2 changes: 1 addition & 1 deletion test/is_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main (void) {
);
} else {
printf (
"PASS: + is_ipv4 (%s => must occur error. but no error!)\n",
"FAIL: + is_ipv4 (%s => must occur error. but no error!)\n",
rip
);
ret = 1;
Expand Down

0 comments on commit 1591203

Please sign in to comment.