--- lbbs/src/menu_proc.c 2025/04/30 09:18:19 1.7 +++ lbbs/src/menu_proc.c 2025/05/06 05:31:26 1.11 @@ -1,16 +1,15 @@ /*************************************************************************** menu_proc.c - description ------------------- - begin : Fri May 6 2005 - copyright : (C) 2005 by Leaflet - email : leaflet@leafok.com + Copyright : (C) 2004-2025 by Leaflet + Email : leaflet@leafok.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * + * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ @@ -34,9 +33,11 @@ int exec_mbem(const char *str) void *hdll; int (*func)(); char *c, *s; - char buf[1024]; + char buf[FILE_PATH_LEN]; + + strncpy(buf, str, sizeof(buf) - 1); + buf[sizeof(buf) - 1] = '\0'; - strcpy(buf, str); s = strstr(buf, "@mod:"); if (s) { @@ -82,22 +83,14 @@ int exitbbs(const char *s) int license(const char *s) { - char temp[256]; - - strcpy(temp, app_home_dir); - strcat(temp, "data/license.txt"); - display_file_ex(temp, 0, 1); + display_file_ex(DATA_LICENSE, 1, 1); return REDRAW; } int copyright(const char *s) { - char temp[256]; - - strcpy(temp, app_home_dir); - strcat(temp, "data/copyright.txt"); - display_file_ex(temp, 0, 1); + display_file_ex(DATA_COPYRIGHT, 1, 1); return REDRAW; } @@ -105,7 +98,9 @@ int copyright(const char *s) int reloadbbsmenu(const char *s) { if (kill(getppid(), SIG_RELOAD_MENU) < 0) + { log_error("Send SIG_RELOAD_MENU signal failed (%d)\n", errno); + } return REDRAW; } @@ -113,7 +108,9 @@ int reloadbbsmenu(const char *s) int shutdownbbs(const char *s) { if (kill(0, SIGTERM) < 0) + { log_error("Send SIGTERM signal failed (%d)\n", errno); + } return REDRAW; }