query about rpcclient process_cmd:

Martin Pool mbp at samba.org
Fri Feb 14 00:08:42 GMT 2003


On 13 Feb 2003, "Gerald (Jerry) Carter" <jerry at samba.org> wrote:
> Hash: SHA1
> 
> On Thu, 13 Feb 2003, Martin Pool wrote:
> 
> > rpcclient.c/process_cmd has
> > 
> >         if (cmd[strlen(cmd) - 1] == '\n')
> >                 cmd[strlen(cmd) - 1] = '\0';
> >     
> >         if (!next_token(&p, buf, " ", sizeof(buf))) {
> >                 return NT_STATUS_OK;
> >         }
> >     
> >         /* strip the trainly \n if it exsists */
> >         len = strlen(buf);
> >         if (buf[len-1] == '\n')
> >                 buf[len-1] = '\0';
> >     
> > Isn't the second check for newline redundant?
> 
> Looks like it to me.

Actually, Tim made the very good suggestion that we ought to change
this to use popt, rather than the current half-assed string handling.
I might make a patch to do this later.

-- 
Martin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20030214/97f1ab4b/attachment.bin


More information about the samba-technical mailing list