summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opk/read.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/opk/read.c b/src/opk/read.c
index 1e9295b..edfd74f 100644
--- a/src/opk/read.c
+++ b/src/opk/read.c
@@ -474,6 +474,12 @@ _opkg_opk_opk_read_data(struct opkg_opk_opk *opk)
size_len_max = lrint(ceil(log10( size_max)));
devmajor_len_max = lrint(ceil(log10(devmajor_max)));
devminor_len_max = lrint(ceil(log10(devminor_max)));
+ if (devmajor_len_max == 0) {
+ devmajor_len_max = 1;
+ }
+ if (devminor_len_max == 0) {
+ devminor_len_max = 1;
+ }
dev_len_max = devmajor_len_max + 2 /* ", " */ + devminor_len_max;
if (dev_len_max > size_len_max) {
size_len_max = dev_len_max;