1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

api: use util functions to parse integers

This commit is contained in:
Sébastien Helleu
2026-06-20 11:16:19 +02:00
parent 4eba4f9a47
commit 90761d6350
2 changed files with 29 additions and 49 deletions
+3 -4
View File
@@ -38,6 +38,7 @@
#include "../core/core-input.h"
#include "../core/core-proxy.h"
#include "../core/core-string.h"
#include "../core/core-util.h"
#include "../gui/gui-bar.h"
#include "../gui/gui-bar-item.h"
#include "../gui/gui-bar-window.h"
@@ -394,7 +395,7 @@ plugin_api_command_options (struct t_weechat_plugin *plugin,
struct t_gui_buffer *buffer, const char *command,
struct t_hashtable *options)
{
char *command2, *error;
char *command2;
const char *ptr_commands_allowed, *ptr_delay, *ptr_split_newline;
long delay;
int rc, split_newline;
@@ -412,9 +413,7 @@ plugin_api_command_options (struct t_weechat_plugin *plugin,
ptr_delay = hashtable_get (options, "delay");
if (ptr_delay)
{
error = NULL;
delay = strtol (ptr_delay, &error, 10);
if (!error || error[0])
if (!util_parse_long (ptr_delay, 10, &delay))
delay = 0;
}
ptr_split_newline = hashtable_get (options, "split_newline");