1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-24 20:00:16 -04:00

fixed crash on move_right, used to memcpy into btm_buffer when thread_btm assumed unchanging size

This commit is contained in:
nova
2025-10-18 17:06:38 +02:00
parent 326d3f7e52
commit 7450280c43

View File

@@ -236,7 +236,7 @@ void move_right(){
if (mid_content->file_name[0] == '\0') {
return;
}
if (mid_content[selected_file_current].file_type &= FILE_TYPE_DIR) {
if ((mid_content[selected_file_current].file_type & FILE_TYPE_DIR) == FILE_TYPE_DIR) {
if (chdir(mid_content[selected_file_current].file_name) != 0) {
FAIL("move_right", "unhandled error of chdir");
} else {
@@ -272,9 +272,7 @@ void move_right(){
char *cmd = concat(mimetype_default_cmd[i].command, " ./\"");
cmd = concat(cmd, mid_content[selected_file_current].file_name);
cmd = concat(cmd, "\"");
btm_buffer = malloc(strlen(cmd));
memcpy(btm_buffer, cmd, strlen(cmd));
if (system(cmd) == -1) {