From 100fb2399417316fb6d5818fbc4e3a843d189bf3 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 18 Aug 2013 04:12:51 -0500 Subject: Remove files du no longer needs. --- lib/lib.h | 3 --- lib/pending.c | 26 -------------------------- 2 files changed, 29 deletions(-) diff --git a/lib/lib.h b/lib/lib.h index 4e657a17..5d1d03c7 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -193,9 +193,6 @@ void mode_to_string(mode_t mode, char *buf); int read_password(char * buff, int buflen, char* mesg); int update_password(char *filename, char* username, char* encrypted); -// du helper functions -char* make_human_readable(unsigned long long size, unsigned long unit); - // cut helper functions unsigned long get_int_value(const char *numstr, unsigned lowrange, unsigned highrange); diff --git a/lib/pending.c b/lib/pending.c index 79b9c91c..9c92f2ce 100644 --- a/lib/pending.c +++ b/lib/pending.c @@ -36,32 +36,6 @@ done: closedir(dp); } -char* make_human_readable(unsigned long long size, unsigned long unit) -{ - unsigned int frac = 0; - if(unit) { - size = (size/(unit)) + (size%(unit)?1:0); - return xmsprintf("%llu", size); - } - else { - static char units[] = {'\0', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'}; - int index = 0; - while(size >= 1024) { - frac = size%1024; - size /= 1024; - index++; - } - frac = (frac/102) + ((frac%102)?1:0); - if(frac >= 10) { - size += 1; - frac = 0; - } - if(frac) return xmsprintf("%llu.%u%c", size, frac, units[index]); - else return xmsprintf("%llu%c", size, units[index]); - } - return NULL; //not reached -} - /* * used to get the interger value. */ -- cgit v1.2.3