[wplug] socket function

Tom Rhodes trhodes at FreeBSD.org
Fri Sep 5 23:54:09 EDT 2008


On Thu, 4 Sep 2008 10:51:03 -0400
"Weber, Lawrence A" <laweber at switch.com> wrote:

> I am working with some simple socket code and found the call:
>  
> inet_addr(argv[2], &myServer.sin.s_addr);
>  
> The manual for inet_addr() says that it only takes one argument, the
> input string.  The function inet_aton() takes 2 args, the input string
> and structure destination.
>  
> The original code seems to work, but I don't know why.  When I replace
> inet_addr with inet_aton the code compiles but does not work.
>  
> I also checked the header file and it agrees with the manual.  
>  
> Any ideas why does inet_addr compile without warnings/errors (and work)
> and why doesn't inet_aton work?
> 

Try compiling with -Wall.

-- 
Tom Rhodes


More information about the wplug mailing list