mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
core: use function util_parse_longlong in function sys_setrlimit
This commit is contained in:
+2
-4
@@ -181,7 +181,7 @@ void
|
||||
sys_setrlimit (void)
|
||||
{
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
char **items, *pos, *error;
|
||||
char **items, *pos;
|
||||
int num_items, i;
|
||||
long long number;
|
||||
|
||||
@@ -198,9 +198,7 @@ sys_setrlimit (void)
|
||||
if (pos)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
error = NULL;
|
||||
number = strtoll (pos + 1, &error, 10);
|
||||
if (error && !error[0])
|
||||
if (util_parse_longlong (pos + 1, 10, &number) && (number >= -1))
|
||||
{
|
||||
sys_setrlimit_resource (items[i], number);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user