aboutsummaryrefslogtreecommitdiff
path: root/src/zyklonb.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-07-13 05:56:30 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-07-13 05:56:30 +0200
commit03ec980f269c8222eaeeb3bbae8c3cab20595bfd (patch)
tree25246d529543e24dc60050f267181c23fa92ba54 /src/zyklonb.c
parent51909edc767966cd677cb65a8c8ca978a97ec655 (diff)
downloadxK-03ec980f269c8222eaeeb3bbae8c3cab20595bfd.tar.gz
xK-03ec980f269c8222eaeeb3bbae8c3cab20595bfd.tar.xz
xK-03ec980f269c8222eaeeb3bbae8c3cab20595bfd.zip
Add a strtoul() wrapper
Diffstat (limited to 'src/zyklonb.c')
-rw-r--r--src/zyklonb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/zyklonb.c b/src/zyklonb.c
index a57b8c4..3d8d388 100644
--- a/src/zyklonb.c
+++ b/src/zyklonb.c
@@ -1418,10 +1418,8 @@ irc_try_reconnect (struct bot_context *ctx)
const char *delay_str = str_map_find (&ctx->config, "reconnect_delay");
hard_assert (delay_str != NULL); // We have a default value for this
- char *end_ptr;
- errno = 0;
- long delay = strtol (delay_str, &end_ptr, 10);
- if (errno != 0 || end_ptr == delay_str || *end_ptr)
+ unsigned long delay;
+ if (!xstrtoul (&delay, delay_str, 10))
{
print_error ("invalid configuration value for `%s'",
"reconnect_delay");