diff --git a/src/proc/process.c b/src/proc/process.c index 70a2165..e40363b 100644 --- a/src/proc/process.c +++ b/src/proc/process.c @@ -4,6 +4,7 @@ #include "proc/scheduler.h" #include "utils/memory.h" #include "utils/math.h" +#include "utils/logger.h" #include "mm/region.h" void process_kernel_spawn(elf_executable_T* executable) { @@ -41,7 +42,7 @@ pid_t process_spawn(pid_t parent, string_t name, elf_executable_T* executable, v process->waiting = bitmap_init(PROCESS_BLOCK_ENUM_SIZE); pipe_init(&process->stdin, process, NULL); - memory_copy(name, process->name, MIN(string_length(name), 127)); + memory_copy(name, process->name, MIN(string_length(name)+1, 127)); process->page_map = page_map_create(); elf_mappings_apply(executable->mappings, executable->num_mappings, buffer, MEM_REGION_PROCESS_EXEC, process->page_map);