diff --git a/src/host-multiview.c b/src/host-multiview.c index 9a7c5f7..8f1722e 100644 --- a/src/host-multiview.c +++ b/src/host-multiview.c @@ -3,7 +3,7 @@ #include #include "uae_pragmas.h" -static const char __ver[40] = "$VER: Host-MultiView v1.0 (2021-09-17)"; +static const char __ver[40] = "$VER: Host-MultiView v1.1 (2024-08-23)"; int print_usage() { @@ -37,8 +37,8 @@ int main(int argc, char *argv[]) } else { - strcat(command, "xdg-open"); - strcat(command, " "); + strncat(command, "xdg-open", sizeof(command) - strlen(command) - 1); + strncat(command, " ", sizeof(command) - strlen(command) - 1); } for (int i = 1; i < argc; i++) @@ -47,16 +47,20 @@ int main(int argc, char *argv[]) { NativeDosOp((ULONG)0, (ULONG)lock, (ULONG)filename, (ULONG)100); UnLock(lock); - strcat(command, filename); + strncat(command, "\"", sizeof(command) - strlen(command) - 1); + strncat(command, filename, sizeof(command) - strlen(command) - 1); + strncat(command, "\"", sizeof(command) - strlen(command) - 1); memset(filename, '\0', 4095); } else { - strcat(command, argv[i]); + strncat(command, "\"", sizeof(command) - strlen(command) - 1); + strncat(command, argv[i], sizeof(command) - strlen(command) - 1); + strncat(command, "\"", sizeof(command) - strlen(command) - 1); } if (i != argc - 1) - strcat(command, " "); + strncat(command, " ", sizeof(command) - strlen(command) - 1); } #ifdef DEBUG