--- lbbs/src/article_del.c 2025/11/04 14:58:56 1.9 +++ lbbs/src/article_del.c 2025/12/19 06:16:26 1.12 @@ -6,6 +6,10 @@ * Copyright (C) 2004-2025 Leaflet */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "article_del.h" #include "database.h" #include "io.h" @@ -29,7 +33,7 @@ int article_del(const SECTION_LIST *p_se if (p_section == NULL || p_article == NULL) { - log_error("NULL pointer error\n"); + log_error("NULL pointer error"); } if (p_article->excerption) // Delete is not allowed @@ -47,7 +51,7 @@ int article_del(const SECTION_LIST *p_se prints("真的要删除文章?(Y)是, (N)否 [N]: "); iflush(); - for (ch = 0; !SYS_server_exit; ch = igetch_t(MAX_DELAY_TIME)) + for (ch = 0; !SYS_server_exit; ch = igetch_t(BBS_max_user_idle_time)) { switch (toupper(ch)) { @@ -75,7 +79,7 @@ int article_del(const SECTION_LIST *p_se db = db_open(); if (db == NULL) { - log_error("db_open() error: %s\n", mysql_error(db)); + log_error("db_open() error: %s", mysql_error(db)); ret = -1; goto cleanup; } @@ -83,14 +87,14 @@ int article_del(const SECTION_LIST *p_se // Begin transaction if (mysql_query(db, "SET autocommit=0") != 0) { - log_error("SET autocommit=0 error: %s\n", mysql_error(db)); + log_error("SET autocommit=0 error: %s", mysql_error(db)); ret = -1; goto cleanup; } if (mysql_query(db, "BEGIN") != 0) { - log_error("Begin transaction error: %s\n", mysql_error(db)); + log_error("Begin transaction error: %s", mysql_error(db)); ret = -1; goto cleanup; } @@ -101,13 +105,13 @@ int article_del(const SECTION_LIST *p_se if (mysql_query(db, sql) != 0) { - log_error("Query article status error: %s\n", mysql_error(db)); + log_error("Query article status error: %s", mysql_error(db)); ret = -1; goto cleanup; } if ((rs = mysql_use_result(db)) == NULL) { - log_error("Get article status data failed\n"); + log_error("Get article status data failed"); ret = -1; goto cleanup; } @@ -152,7 +156,7 @@ int article_del(const SECTION_LIST *p_se if (mysql_query(db, sql) != 0) { - log_error("Update article status error: %s\n", mysql_error(db)); + log_error("Update article status error: %s", mysql_error(db)); ret = -1; goto cleanup; } @@ -173,7 +177,7 @@ int article_del(const SECTION_LIST *p_se if (mysql_query(db, sql) != 0) { - log_error("Update exp error: %s\n", mysql_error(db)); + log_error("Update exp error: %s", mysql_error(db)); ret = -1; goto cleanup; } @@ -188,7 +192,7 @@ int article_del(const SECTION_LIST *p_se if (mysql_query(db, sql) != 0) { - log_error("Add log error: %s\n", mysql_error(db)); + log_error("Add log error: %s", mysql_error(db)); ret = -1; goto cleanup; } @@ -202,7 +206,7 @@ int article_del(const SECTION_LIST *p_se if (mysql_query(db, sql) != 0) { - log_error("Update article error: %s\n", mysql_error(db)); + log_error("Update article error: %s", mysql_error(db)); ret = -1; goto cleanup; } @@ -211,7 +215,7 @@ int article_del(const SECTION_LIST *p_se // Commit transaction if (mysql_query(db, "COMMIT") != 0) { - log_error("Commit transaction error: %s\n", mysql_error(db)); + log_error("Commit transaction error: %s", mysql_error(db)); ret = -1; goto cleanup; }