mirror of
https://gittea.dev/nova/th.git
synced 2025-10-25 12:20: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:
@@ -236,7 +236,7 @@ void move_right(){
|
|||||||
if (mid_content->file_name[0] == '\0') {
|
if (mid_content->file_name[0] == '\0') {
|
||||||
return;
|
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) {
|
if (chdir(mid_content[selected_file_current].file_name) != 0) {
|
||||||
FAIL("move_right", "unhandled error of chdir");
|
FAIL("move_right", "unhandled error of chdir");
|
||||||
} else {
|
} else {
|
||||||
@@ -272,9 +272,7 @@ void move_right(){
|
|||||||
char *cmd = concat(mimetype_default_cmd[i].command, " ./\"");
|
char *cmd = concat(mimetype_default_cmd[i].command, " ./\"");
|
||||||
cmd = concat(cmd, mid_content[selected_file_current].file_name);
|
cmd = concat(cmd, mid_content[selected_file_current].file_name);
|
||||||
cmd = concat(cmd, "\"");
|
cmd = concat(cmd, "\"");
|
||||||
btm_buffer = malloc(strlen(cmd));
|
|
||||||
|
|
||||||
memcpy(btm_buffer, cmd, strlen(cmd));
|
|
||||||
|
|
||||||
|
|
||||||
if (system(cmd) == -1) {
|
if (system(cmd) == -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user