changeset 32:08a465eec50b

[Dowa] Fixed a bug that I caused trying to stop memory leak lol.
author June Park <parkjune1995@gmail.com>
date Thu, 09 Oct 2025 07:03:36 -0700
parents 2852b2e2363f
children c0f6c8c7829f
files dowa/d_memory.c mrjunejune/pages/react/index.html seobeo/BUILD
diffstat 3 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/dowa/d_memory.c	Thu Oct 09 06:55:07 2025 -0700
+++ b/dowa/d_memory.c	Thu Oct 09 07:03:36 2025 -0700
@@ -360,8 +360,8 @@
       if (!f) { perror("fopen"); continue; }
 
       void *buf = p_hash_map->p_arena ? 
-        Dowa_Arena_Allocate(p_hash_map->p_arena, size+1) :
-        malloc(size+1);
+        Dowa_Arena_Allocate(p_hash_map->p_arena, size) :
+        malloc(size);
       if (!buf) { perror("malloc"); fclose(f); closedir(dir); return -1; }
 
 
@@ -374,10 +374,7 @@
       }
       fclose(f);
 
-      // null-terminate since the files don't do this and we need this for print.
-      ((unsigned char*)buf)[size] = '\0';
-
-      Dowa_HashMap_Push_Value_With_Type(p_hash_map, entry->d_name, buf, size + 1, DOWA_HASH_MAP_TYPE_STRING);
+      Dowa_HashMap_Push_Value_With_Type(p_hash_map, entry->d_name, buf, size, DOWA_HASH_MAP_TYPE_STRING);
       free(buf);  // Dowa_HashMap_PushValue made its own copy
     }
     else if (S_ISDIR(st.st_mode))
--- a/mrjunejune/pages/react/index.html	Thu Oct 09 06:55:07 2025 -0700
+++ b/mrjunejune/pages/react/index.html	Thu Oct 09 07:03:36 2025 -0700
@@ -4,6 +4,7 @@
   </head>
   <body>
     <div id="root"></div>
+    <p> Hello </p>
   </body>
   <script src="/hello.js"></script>
 </html>
--- a/seobeo/BUILD	Thu Oct 09 06:55:07 2025 -0700
+++ b/seobeo/BUILD	Thu Oct 09 07:03:36 2025 -0700
@@ -46,7 +46,7 @@
     "s_web.c",
     "os/s_linux_edge.c",
   ],
-  hdrs = [":seobeo_hrs"],
+  hdrs = [":seobeo_hdrs"],
   deps = [
     "//dowa:dowa",
     "@openssl//:ssl",