[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Useless test
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2007-09-28 22:02:40
Message-ID: 200709282302.40145.vda.linux () googlemail ! com
[Download RAW message or body]

On Friday 28 September 2007 03:49, Loïc Grenié wrote:
>      The if () test is useless because it has already been done above.


                if (flags & (PSSCAN_CMD|PSSCAN_ARGV0)) {
                        if (sp->argv0) {
                                free(sp->argv0);
                                sp->argv0 = NULL;
                        }
                        if (sp->cmd) {
                                free(sp->cmd);
                                sp->cmd = NULL;
                        }
                        strcpy(filename_tail, "/cmdline");
                        /* TODO: to get rid of size limits, read into malloc buf,
                         * then realloc it down to real size. */
                        n = read_to_buf(filename, buf);
                        if (n <= 0)
                                break;
                        if (flags & PSSCAN_ARGV0)
                                sp->argv0 = xstrdup(buf);


I do not see why (flags & PSSCAN_ARGV0) is true in last if().
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic