Bug reported by the clang static analyzer.
File: /home/cindy/toybox-2014-11-18/toys/other/chvt.c
Line: 24
Description: Assigned value is garbage or undefined
File: /home/cindy/toybox-2014-11-18/toys/other/losetup.c
Line: 64
diff -r b5968bffb65c toys/other/chvt.c
--- a/toys/other/chvt.c Tue Nov 18 04:25:27 2014 -0600
+++ b/toys/other/chvt.c Tue Nov 18 14:58:00 2014 -0800
@@ -21,7 +21,7 @@
void chvt_main(void)
{
- int vtnum, fd = fd;
+ int vtnum, fd = -2;
char *consoles[]={"/dev/console", "/dev/vc/0", "/dev/tty", NULL}, **cc;
vtnum=atoi(*toys.optargs);
diff -r b5968bffb65c toys/other/losetup.c
--- a/toys/other/losetup.c Tue Nov 18 04:25:27 2014 -0600
+++ b/toys/other/losetup.c Tue Nov 18 14:58:00 2014 -0800
@@ -61,7 +61,7 @@
static void loopback_setup(char *device, char *file)
{
struct loop_info64 *loop = (void *)(toybuf+32);
- int lfd = -1, ffd = ffd;
+ int lfd = -1, ffd = -1;
unsigned flags = toys.optflags;
// Open file (ffd) and loop device (lfd)
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net