[BusyBox] Re: [BusyBox-cvs] busybox/editors sed.c,1.167,1.168

Bastian Blank waldi at debian.org
Sat May 15 17:48:26 UTC 2004


On Mon, May 10, 2004 at 08:59:19AM +0000, Glenn McGrath wrote:
> Index: sed.c
> ===================================================================
> RCS file: /var/cvs/busybox/editors/sed.c,v
> retrieving revision 1.167
> retrieving revision 1.168
> diff -u -d -r1.167 -r1.168
> --- a/sed.c	25 Apr 2004 05:11:15 -0000	1.167
> +++ b/sed.c	10 May 2004 08:59:17 -0000	1.168
> @@ -1096,7 +1096,9 @@
>  
>  extern int sed_main(int argc, char **argv)
>  {
> -	char opt, getpat=1, status = EXIT_SUCCESS;
> +	int opt;
> +	char getpat=1;
> +	char status = EXIT_SUCCESS;
>  
>  #ifdef CONFIG_FEATURE_CLEAN_UP
>  	/* destroy command strings on exit */
> 

This patch is broken.
- The return value of main is int and EXIT_SUCCESS/_FAILURE are int
  constants, it is not defined if they are convertable into char.
- char access is horrible expensive on many arches, either runtime or
  code size, use bool if you want such.

Bastian

-- 
	"Beauty is transitory."
	"Beauty survives."
		-- Spock and Kirk, "That Which Survives", stardate unknown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.busybox.net/pipermail/busybox/attachments/20040515/264fdbae/attachment-0002.pgp 


More information about the busybox mailing list