--- lbbs/src/user_stat.c 2025/10/23 05:54:16 1.2 +++ lbbs/src/user_stat.c 2025/11/11 00:28:05 1.6 @@ -1,18 +1,14 @@ -/*************************************************************************** - user_list.c - description - ------------------- - 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 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * user_stat + * - data model and basic operations of user related statistics + * + * Copyright (C) 2004-2025 Leaflet + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "log.h" #include "section_list.h" @@ -74,7 +70,7 @@ int user_stat_map_update(USER_STAT_MAP * log_error("article_block_find_by_index(index=%d) error\n", i); break; } - + if (p_article->visible == 0) { continue; @@ -121,7 +117,7 @@ int user_stat_article_cnt_inc(USER_STAT_ mid = (left + right) / 2; if (uid < p_map->stat_list[mid].uid) { - right = mid; + right = mid - 1; } else if (uid > p_map->stat_list[mid].uid) { @@ -163,7 +159,7 @@ int user_stat_get(USER_STAT_MAP *p_map, mid = (left + right) / 2; if (uid < p_map->stat_list[mid].uid) { - right = mid; + right = mid - 1; } else if (uid > p_map->stat_list[mid].uid) {