From: kosmirror <kos...@us...> - 2025-08-05 13:34:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via c71cc6e505324e35235208c574c04b3a872c2fba (commit) via 3c96383b3b06c4448bdac3bd6702a4c3eff2a638 (commit) from 892ca798ed79edfc507e447755c630e0ea2f9930 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c71cc6e505324e35235208c574c04b3a872c2fba Author: Falco Girgis <gyr...@gm...> Date: Tue Aug 5 00:51:51 2025 -0500 Forgot to remove manual NULL terminator. commit 3c96383b3b06c4448bdac3bd6702a4c3eff2a638 Author: Falco Girgis <gyr...@gm...> Date: Tue Aug 5 00:50:37 2025 -0500 Fixed string-related warnings. The following functions: 1) realpath() 2) fs_normalize_path() had annoying warnings about strncpy() calls which don't copy enough from the source buffer to include its NULL terminator... which... it's not actually a problem, since the lines right after had us manually terminating the strings, but... this appeases GCC, so whatever. ----------------------------------------------------------------------- Summary of changes: kernel/fs/fs_utils.c | 3 +-- kernel/libc/koslib/realpath.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/fs/fs_utils.c b/kernel/fs/fs_utils.c index 41190f43..b65c285e 100644 --- a/kernel/fs/fs_utils.c +++ b/kernel/fs/fs_utils.c @@ -203,8 +203,7 @@ char *fs_normalize_path(const char *__restrict path, char *__restrict resolved) /* Handle absolute path. */ if(path[0] == '/') { - strncpy(temp_path, path, len); - temp_path[len] = '\0'; + strcpy(temp_path, path); } else { /* Handle relative path: prepend current working directory. */ diff --git a/kernel/libc/koslib/realpath.c b/kernel/libc/koslib/realpath.c index 8db7516b..ab4892c8 100644 --- a/kernel/libc/koslib/realpath.c +++ b/kernel/libc/koslib/realpath.c @@ -42,8 +42,7 @@ char *realpath(const char *__restrict path, char *__restrict resolved) { /* Handle absolute path. */ if(path[0] == '/') { - strncpy(temp_path, path, len); - temp_path[len] = '\0'; + strcpy(temp_path, path); } else { /* Handle relative path: prepend current working directory. */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |