diff options
author | Eric Bénard <eric@eukrea.com> | 2012-08-28 17:24:26 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-08-29 09:10:13 +0200 |
commit | 738c57eeaa7958aae6600f6f668fbda8a5128cd4 (patch) | |
tree | 2319b86a64856b347edfe8e961e714c39bb78e58 /lib/stringlist.c | |
parent | 00dfde27424d7ce1ae662ee7d4b9d636574f5421 (diff) | |
download | barebox-738c57eeaa7958aae6600f6f668fbda8a5128cd4.tar.gz barebox-738c57eeaa7958aae6600f6f668fbda8a5128cd4.tar.xz |
stringlist: fix division by zero
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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/stringlist.c')
-rw-r--r-- | lib/stringlist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/stringlist.c b/lib/stringlist.c index b965aa058c..a8af15d757 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) { |