quick fix to hush.c

Robert P. J. Day rpjday at mindspring.com
Tue Jul 18 05:05:16 PDT 2006


  i just committed the following cheap and easy fix to hush.c:

==================================
--- hush.c      (revision 15716)
+++ hush.c      (working copy)
@@ -1284,7 +1284,7 @@
        int i;
        int nextin, nextout;
        int pipefds[2];                         /* pipefds[0] is for reading */
-       struct child_prog *child;
+       struct child_prog *child = NULL;
        const struct built_in_command *x;
        char *p;
=================================

to get around the following:

  CC shell/hush.o
/home/rpjday/bbx/busybox/shell/hush.c: In function `run_pipe_real':
/home/rpjday/bbx/busybox/shell/hush.c:1287: warning: `child' might be used uninitialized in this function
make[1]: *** [/home/rpjday/bbx/busybox/shell/hush.o] Error 1
make: *** [busybox] Error 2


rday

p.s.  that warning could be avoided by restructuring the control flow
of that code as well, but i'll go with the easy solution right now.


More information about the busybox mailing list