> #define MAXARG  4
> static char     *dirs[MAXARG+1];

a 5 element array of pointers to characters (strings).

>         ac--; av++;
>         if (ac==0) dirs[0] = "/tftpboot";  /* default directory */
>         while (ac-- > 0 && n < MAXARG)
>                 dirs[n++] = *av++;             

> 1.  It looks to me like 'dirs' is set to be a 5 character
>       string by the MAXARG define, then they turn around
>       and set a default of 9 characters? Didn't they just
>       run right off the end of the array?

nope - it's an array of strings (pointers to strings, actually)

>       the maximum size for each argument? If that's in some

they don't.  It's a char * - it can point to as much memory as they can
malloc.

> 3. Stylistically, is that 'while' statement normal? It looks to
>       me like a syntax mistake waiting to happen, but I'll code
>       to that style if it's normal for C programmers. Coming
>       from a mostly perl background that line would either be
>       one line or enclosed in curly braces.

there is no 'normal'.  If that makes sense to the programmer, then fine.
It is not particularly obfuscated...  code to however makes sense to you.
Just don't make it look like perl. ;)


Tim


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to