From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Eric Bénard" <eric@eukrea.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] stringlist: fix division by zero
Date: Wed, 29 Aug 2012 09:10:25 +0200 [thread overview]
Message-ID: <20120829071025.GS26594@pengutronix.de> (raw)
In-Reply-To: <1346167466-10098-2-git-send-email-eric@eukrea.com>
On Tue, Aug 28, 2012 at 05:24:26PM +0200, Eric Bénard wrote:
> len is checked instead of num so when num is zero, we get a
> division by zero a few lines later
>
> Signed-off-by: Eric Bénard <eric@eukrea.com>
Applied, thanks
Sascha
> ---
> lib/stringlist.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/stringlist.c b/lib/stringlist.c
> index b965aa0..a8af15d 100644
> --- a/lib/stringlist.c
> +++ b/lib/stringlist.c
> @@ -87,8 +87,8 @@ void string_list_print_by_column(struct string_list *sl)
> return;
>
> num = 80 / (len + 1);
> - if (len == 0)
> - len = 1;
> + if (num == 0)
> + num = 1;
>
> i = 0;
> list_for_each_entry(entry, &sl->list, list) {
> --
> 1.7.7.6
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-08-29 7:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-28 15:24 [PATCH 1/2] usb_hub_power_on: wait for the power to be stable Eric Bénard
2012-08-28 15:24 ` [PATCH 2/2] stringlist: fix division by zero Eric Bénard
2012-08-29 7:10 ` Sascha Hauer [this message]
2012-08-28 15:30 ` [PATCH 1/2] usb_hub_power_on: wait for the power to be stable Eric Bénard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120829071025.GS26594@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=eric@eukrea.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox