cleanup: const and type hygeine in tabcompletion module

This commit is contained in:
2026-06-18 12:20:25 +02:00
parent 2ddb704582
commit a96519f8a6
2 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -12,4 +12,4 @@
#pragma once #pragma once
#define MONTAUK_BUILD_NUMBER 110 #define MONTAUK_BUILD_NUMBER 112
+6 -7
View File
@@ -48,18 +48,17 @@ int find_first_slash_pos(const char* string) {
/* /*
i.e., "shell.elf" => "shell" i.e., "shell.elf" => "shell"
*/ */
const char* strip_elf_extension(const char* path) { const char* strip_elf_extension(char* path) {
size_t len = montauk::slen(path); size_t len = montauk::slen(path);
char* p = (char* ) path; path[len - 4] = '\0';
p[len - 4] = '\0';
return (const char*)p; return (const char*)path;
} }
const char* build_montauk_path( const char* build_montauk_path(
char* buffer, char* buffer,
int max, size_t max,
int volume_number, int volume_number,
const char* subpath const char* subpath
@@ -79,7 +78,7 @@ const char* build_montauk_path(
int pos = 0; int pos = 0;
for (int i = 0; i < vn_length; i++) { for (size_t i = 0; i < vn_length; i++) {
buffer[pos] = volume_number_str[i]; buffer[pos] = volume_number_str[i];
pos++; pos++;
} }
@@ -87,7 +86,7 @@ const char* build_montauk_path(
buffer[pos] = ':'; pos++; buffer[pos] = ':'; pos++;
buffer[pos] = '/'; pos++; buffer[pos] = '/'; pos++;
for (int i = 0; i < subpath_length; i++) { for (size_t i = 0; i < subpath_length; i++) {
buffer[pos] = subpath[i]; buffer[pos] = subpath[i];
pos++; pos++;
} }