From 6091b058a0593beec0ec3df1850a70a039960f8c Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 5 Oct 2016 13:26:19 +0000 Subject: [PATCH] fix ConvertSizeToKb() function for case when size is less than 1Kb git-svn-id: svn://kolibrios.org@6568 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/clipview/clipview.c | 2 +- programs/cmm/lib/file_system.h | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/programs/cmm/clipview/clipview.c b/programs/cmm/clipview/clipview.c index 091e91a1a7..7b2982f200 100644 --- a/programs/cmm/clipview/clipview.c +++ b/programs/cmm/clipview/clipview.c @@ -17,7 +17,7 @@ // // //===================================================// -?define WINDOW_HEADER "Clipboard viewer v1.0" +?define WINDOW_HEADER "Clipboard viewer v1.01" ?define T_DELETE_LAST_SLOT "Delete last slot" ?define T_DELETE_ALL_SLOTS "Delete all slots" ?define T_RESET_BUFFER_LOCK "Reset the lock buffer" diff --git a/programs/cmm/lib/file_system.h b/programs/cmm/lib/file_system.h index 103f12b9f4..cb3e4798c1 100644 --- a/programs/cmm/lib/file_system.h +++ b/programs/cmm/lib/file_system.h @@ -307,9 +307,17 @@ enum unsigned int kb; dword kb_line; - kb_line = itoa(bytes / 1024); - strcpy(#size, kb_line); - strcat(#size, " Kb"); + if (bytes >= 1024) + { + kb_line = itoa(bytes / 1024); + strcpy(#size, kb_line); + strcat(#size, " Kb"); + } + else { + kb_line = itoa(bytes); + strcpy(#size, kb_line); + strcat(#size, " b"); + } return #size; }