From f34cb85ca3eedf4ce78f5ec03937b00930f0028a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 5 Apr 2026 17:02:44 +0200 Subject: [PATCH] core: use function util_parse_int in function gui_hotlist_clear_level_string --- src/gui/gui-hotlist.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c index 06a49dd1a..b775b1c42 100644 --- a/src/gui/gui-hotlist.c +++ b/src/gui/gui-hotlist.c @@ -623,10 +623,8 @@ void gui_hotlist_clear_level_string (struct t_gui_buffer *buffer, const char *str_level_mask) { - long level_mask; - char *error; struct t_gui_hotlist *ptr_hotlist; - int priority; + int level_mask, priority; if (str_level_mask) { @@ -665,11 +663,9 @@ gui_hotlist_clear_level_string (struct t_gui_buffer *buffer, else { /* clear hotlist using a mask of levels */ - error = NULL; - level_mask = strtol (str_level_mask, &error, 10); - if (error && !error[0] && (level_mask > 0)) + if (util_parse_int (str_level_mask, 10, &level_mask) && (level_mask > 0)) { - gui_hotlist_clear ((int)level_mask); + gui_hotlist_clear (level_mask); gui_hotlist_initial_buffer = buffer; } }