summaryrefslogtreecommitdiff
path: root/num.c
diff options
context:
space:
mode:
Diffstat (limited to 'num.c')
-rw-r--r--num.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/num.c b/num.c
index 4414515..8670f61 100644
--- a/num.c
+++ b/num.c
@@ -87,27 +87,30 @@ int main(int argc, char *argv[])
for(f = 1; f < argc; f++)
{
num = strtoull(argv[f], NULL, 0);
- snum=(signed long long)num;
if (num < 0x100ull)
{
h_width = 2;
b_width = 8;
+ snum=(signed char)num;
}
else if (num < 0x10000ull)
{
h_width = 4;
b_width = 16;
+ snum=(signed short)num;
}
else if (num < 0x100000000ull)
{
h_width = 8;
b_width = 32;
+ snum=(signed long)num;
}
else
{
h_width = 16;
b_width = 64;
+ snum=(signed long long)num;
}
printf("Original : %s\n", argv[f]);