]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - stat.c
Fix a sizeof bug
[xonotic/gmqcc.git] / stat.c
diff --git a/stat.c b/stat.c
index 4cd82bc7b46d4607001221c14d39f24e6249cd65..287ec0bf583721cd4e2a980d385ded02180963bd 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -24,7 +24,6 @@
 
 #include <string.h>
 #include <stdlib.h>
-#include <ctype.h>
 
 #include "gmqcc.h"
 
@@ -72,8 +71,8 @@ static stat_mem_block_t *stat_mem_block_root        = NULL;
  */
 static stat_size_table_t stat_size_new(void) {
     return (stat_size_table_t)memset(
-        mem_a(sizeof(stat_size_entry_t) * ST_SIZE),
-        0, ST_SIZE * sizeof(stat_size_entry_t)
+        mem_a(sizeof(stat_size_entry_t*) * ST_SIZE),
+        0, ST_SIZE * sizeof(stat_size_entry_t*)
     );
 }
 
@@ -613,7 +612,7 @@ static void stat_dump_mem_contents(stat_mem_block_t *memory, uint16_t cols) {
                 con_out("%c",
                     (j >= memory->size)
                         ? ' '
-                        : (isprint(((unsigned char*)(memory + 1))[j]))
+                        : (util_isprint(((unsigned char*)(memory + 1))[j]))
                             ? 0xFF & ((unsigned char*)(memory + 1)) [j]
                             : '.'
                 );