[PATCH 2/2] stringlist: fix division by zero
Sascha Hauer
s.hauer at pengutronix.de
Wed Aug 29 03:10:25 EDT 2012
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 at 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 at 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 |
More information about the barebox
mailing list