1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +02:00

core: fix integer overflow and return "unsigned long" in function util_version_number

This commit is contained in:
Sébastien Helleu
2025-05-08 18:37:47 +02:00
parent f6cace609c
commit 2bc290b6ed
13 changed files with 49 additions and 45 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ plugin_api_info_version_number_cb (const void *pointer, void *data,
(void) arguments;
snprintf (
version_number, sizeof (version_number), "%d",
version_number, sizeof (version_number), "%lu",
util_version_number (
(arguments && arguments[0]) ? arguments : version_get_version ()));
return strdup (version_number);
+2 -1
View File
@@ -1109,7 +1109,8 @@ script_repo_file_read (int quiet)
const char *ptr_desc;
gzFile file;
struct t_script_repo *script;
int version_number, version_ok, script_ok;
unsigned long version_number;
int version_ok, script_ok;
struct tm tm_script;
struct t_hashtable *descriptions;
+2 -2
View File
@@ -76,7 +76,7 @@ struct t_weelist_item;
* please change the date with current one; for a second change at same
* date, increment the 01, otherwise please keep 01.
*/
#define WEECHAT_PLUGIN_API_VERSION "20250507-01"
#define WEECHAT_PLUGIN_API_VERSION "20250508-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -467,7 +467,7 @@ struct t_weechat_plugin
int (*util_strftimeval) (char *string, int max, const char *format,
struct timeval *tv);
int (*util_parse_time) (const char *datetime, struct timeval *tv);
int (*util_version_number) (const char *version);
unsigned long (*util_version_number) (const char *version);
/* sorted lists */
struct t_weelist *(*list_new) (void);