Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
zziplib
bsc1129403-prevent-division-by-zero.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc1129403-prevent-division-by-zero.patch of Package zziplib
Index: zziplib-0.13.67/bins/unzip-mem.c =================================================================== --- zziplib-0.13.67.orig/bins/unzip-mem.c +++ zziplib-0.13.67/bins/unzip-mem.c @@ -191,6 +191,7 @@ static void zzip_mem_entry_direntry_star static void zzip_mem_entry_direntry_done (void) { char exp = ' '; + long percentage; if (sum_usize / 1024 > 1024*1024*1024) { exp = 'G'; sum_usize /= 1024*1024*1024; sum_usize /= 1024*1024*1024; } if (sum_usize > 1024*1024*1024) { exp = 'M'; @@ -204,9 +205,10 @@ static void zzip_mem_entry_direntry_done return; verbose: printf("-------- ------ ------- ----- ----\n"); + percentage = sum_usize ? (L (100 - (sum_csize*100/sum_usize))) : 0; /* 0% if file size is 0 */ printf("%8li%c %8li%c %3li%% %8li %s\n", L sum_usize, exp, L sum_csize, exp, - L (100 - (sum_csize*100/sum_usize)), L sum_files, + percentage, L sum_files, sum_files == 1 ? "file" : "files"); } @@ -236,9 +238,12 @@ static void zzip_mem_entry_direntry(ZZIP if (*name == '\n') name++; if (option_verbose) { + long percentage; + + percentage = usize ? (L (100 - (csize*100/usize))) : 0; /* 0% if file size is 0 */ printf("%8li%c %s %8li%c%3li%% %s %8lx %s %s\n", L usize, exp, comprlevel[compr], L csize, exp, - L (100 - (csize*100/usize)), + percentage, _zzip_ctime(&mtime), crc32, name, comment); } else { printf(" %8li%c %s %s %s\n",
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor