mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-15 07:30:13 +00:00
23 lines
384 B
C
23 lines
384 B
C
|
#include <stdio.h>
|
||
|
#include <sys/socket.h>
|
||
|
#include <netinet/in.h>
|
||
|
#include <arpa/inet.h>
|
||
|
|
||
|
enum { buf_size = 16 };
|
||
|
static char buf[buf_size] = "323543357756889";
|
||
|
|
||
|
int
|
||
|
main (int argc, char *argv[])
|
||
|
{
|
||
|
struct in_addr addr;
|
||
|
int result = 0;
|
||
|
|
||
|
if (inet_aton (buf, &addr) != 0)
|
||
|
{
|
||
|
printf ("%s is seen as a valid IP address\n", buf);
|
||
|
result = 1;
|
||
|
}
|
||
|
|
||
|
return result;
|
||
|
}
|