--- lbbs/src/database.c 2025/05/02 03:32:19 1.10 +++ lbbs/src/database.c 2025/05/06 05:31:26 1.13 @@ -1,21 +1,21 @@ /*************************************************************************** database.c - description ------------------- - begin : Mon Oct 11 2004 - copyright : (C) 2004 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. * * * ***************************************************************************/ #include "common.h" +#include "database.h" #include "log.h" #include #include @@ -30,7 +30,7 @@ char DB_timezone[50]; MYSQL *db_open() { MYSQL *db; - char sql[1024]; + char sql[SQL_BUFFER_LEN]; db = mysql_init(NULL); if (db == NULL) @@ -53,7 +53,7 @@ MYSQL *db_open() return NULL; } - sprintf(sql, + snprintf(sql, sizeof(sql), "SET time_zone = '%s'", DB_timezone);