bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] [PATCH 3/7] argp'fied argument parsing & tiny fixes


From: Sergey Poznyakoff
Subject: Re: [bug-inetutils] [PATCH 3/7] argp'fied argument parsing & tiny fixes
Date: Fri, 22 Aug 2008 22:31:39 +0300

Hi Arash,

Thanks for the patches.  A couple of notes:

> telnet/commands.c:
> -static char line[256];
> -static char saveline[256];
> +static char line[MAX_BUF_SIZ];
> +static char saveline[MAX_BUF_SIZ];
[..and then..]
> -      strcpy (saveline, line);       /* save for shell command */
> +      strncpy (saveline, line, MAX_BUF_SIZ); /* save for shell command */

I'd suggest changing all these to `static char *', and replacing
strncpys with simple assignements.

> rcp/rcp.c:
>         * Moved 'fflag' and 'tflag' out of main ()
> rlogind/rlogind.c
>         * Moved 'maxchildren', 'mode' and 'port' out of main ()

These are used only inside main, so there is no reason for making them
global.  To pass them to parse_opt, pack them into a structure and pass
a pointer to it as the last argument of argp_parse.  Get that pointer
from parse_opt using child_inputs (a member of struct argp_state passed as
the third argument to parse_opt).

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]