]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
FIX: too small string?
authoriceman1001 <iceman@iuse.se>
Sat, 22 Oct 2016 22:58:40 +0000 (00:58 +0200)
committericeman1001 <iceman@iuse.se>
Sat, 22 Oct 2016 22:58:40 +0000 (00:58 +0200)
client/cmdhw.c

index f38a6c7cb7a1b3887dc6faf407ac156a51e65440..24b4bada9d69798d5d956a2fa538ea9133a8b332 100644 (file)
@@ -26,7 +26,7 @@ static int CmdHelp(const char *Cmd);
 
 static void lookupChipID(uint32_t iChipID, uint32_t mem_used)
 {
 
 static void lookupChipID(uint32_t iChipID, uint32_t mem_used)
 {
-       char asBuff[100];
+       char asBuff[120];
        memset(asBuff, 0, sizeof(asBuff));
        uint32_t mem_avail = 0;
        
        memset(asBuff, 0, sizeof(asBuff));
        uint32_t mem_avail = 0;
        
@@ -140,14 +140,14 @@ static void lookupChipID(uint32_t iChipID, uint32_t mem_used)
        
        uint32_t mem_left = 0;
        if ( mem_avail > 0 ) 
        
        uint32_t mem_left = 0;
        if ( mem_avail > 0 ) 
-               mem_left = mem_avail * 1024 - mem_used;
+               mem_left = (mem_avail * 1024) - mem_used;
        
        PrintAndLog("Nonvolatile Program Memory Size: %uK bytes. Used: %u bytes (%2.0f\%). Free: %u bytes (%2.0f\%).", 
                                mem_avail, 
                                mem_used, 
        
        PrintAndLog("Nonvolatile Program Memory Size: %uK bytes. Used: %u bytes (%2.0f\%). Free: %u bytes (%2.0f\%).", 
                                mem_avail, 
                                mem_used, 
-                               mem_avail == 0 ? 0.0f : (float)(mem_used/(mem_avail*1024))*100,
+                               mem_avail == 0 ? 0.0f : (float)mem_used/(mem_avail*1024)*100,
                                mem_left,
                                mem_left,
-                               mem_avail == 0 ? 0.0f : (float)(mem_left/(mem_avail*1024))*100
+                               mem_avail == 0 ? 0.0f : (float)mem_left/(mem_avail*1024)*100
                                );
        switch((iChipID&0xF000)>>12)
        {
                                );
        switch((iChipID&0xF000)>>12)
        {
Impressum, Datenschutz