Fixing gcc 3.3 compile failures -- fix for net/netsaint-plugins

Simon Barner barner at in.tum.de
Tue Jul 22 16:57:59 PDT 2003


> > --- plugins/check_by_ssh.c.orig	Mon Apr 23 09:43:11 2001
> > +++ plugins/check_by_ssh.c	Tue Jul 22 05:05:52 2003
> > @@ -191,7 +191,7 @@
> >  	if (commands>1)
> >  		remotecmd=strscat(remotecmd,";echo STATUS CODE: $?;");
> >  
> > -	if (strlen (remotecmd) <= 1)
> > +	if (remotecmd==NULL)
> >  		usage ("No remotecmd\n");
> >  
> >  	comm = ssprintf(comm,"%s %s '%s'",comm,hostname,remotecmd);
> 
> This looks like more than a fix for a `compile failure'.  The
> replacement code has different semantics than the new code.
> What is the `compile failure' that was being fixed here?

I don't know, either. This patch was part of the port before I touched
it [1]. Perhaps one should write

if ((remotecmd==NULL) || (strlen (remotecmd) <= 1))

to be on the safe side?

Cheers,
 Simon
 
[1]:
http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/ports/net/netsaint-plugins/files/patch-check_by_ssh.c?rev=1.1&content-type=text/plain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: Digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20030723/373af2de/attachment.bin


More information about the freebsd-current mailing list