aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/numconvert.c
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2021-10-11 19:19:53 -0800
committerDavid M. Syzdek <david@syzdek.net>2021-10-11 19:19:53 -0800
commitd2ee4fc56477e9d5bfb18c629585db9cac310190 (patch)
tree0815f0a1821a36ab0005da22a36218d2a06f8465 /src/numconvert.c
parent65f5bbfcafb63aebf63df2ff32f2be9275aaa0b2 (diff)
downloaddmstools-d2ee4fc56477e9d5bfb18c629585db9cac310190.tar.gz
dmstools-d2ee4fc56477e9d5bfb18c629585db9cac310190.tar.bz2
dmstools-d2ee4fc56477e9d5bfb18c629585db9cac310190.tar.xz
dmstools-d2ee4fc56477e9d5bfb18c629585db9cac310190.zip
numconvert: fixing padding
Diffstat (limited to 'src/numconvert.c')
-rw-r--r--src/numconvert.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/numconvert.c b/src/numconvert.c
index 17db6f1..16b7bb1 100644
--- a/src/numconvert.c
+++ b/src/numconvert.c
@@ -341,19 +341,12 @@ void my_print(int32_t opt, uintmax_t num, const char * order)
341 uintmax_t max; 341 uintmax_t max;
342 uintmax_t byte; 342 uintmax_t byte;
343 343
344 max = sizeof(intmax_t);
345 len = 0; 344 len = 0;
346 345
347 // determine padding 346 // determine padding
347 max = sizeof(intmax_t);
348 if (opt & MY_OPT_LIMIT) 348 if (opt & MY_OPT_LIMIT)
349 { 349 max = 4;
350 max = 1;
351 for(y = 0; y < (intmax_t)sizeof(intmax_t); y++)
352 if ( (num >> (y*8)) & 0xFF )
353 max = (y+1);
354 if (max < 2)
355 max = 4;
356 };
357 350
358 for(pos = 0; (pos < strlen(order)); pos++) 351 for(pos = 0; (pos < strlen(order)); pos++)
359 { 352 {