diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-02-07 22:10:43 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-02-07 22:11:53 +0100 |
commit | 61ad99b611c454eaacc8709d313fa7db078eff29 (patch) | |
tree | 461d4797e14618f7b4b13b04e1690e77f3723583 /src/sdtui.c | |
parent | 99116d0f70f4104b8415f36f8cab9c22c36a069c (diff) | |
download | tdv-61ad99b611c454eaacc8709d313fa7db078eff29.tar.gz tdv-61ad99b611c454eaacc8709d313fa7db078eff29.tar.xz tdv-61ad99b611c454eaacc8709d313fa7db078eff29.zip |
Make more use of xstrtoul()
Diffstat (limited to 'src/sdtui.c')
-rw-r--r-- | src/sdtui.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/sdtui.c b/src/sdtui.c index 4961928..8456fb2 100644 --- a/src/sdtui.c +++ b/src/sdtui.c @@ -1350,10 +1350,8 @@ on_watch_primary_selection (G_GNUC_UNUSED const gchar *option_name, return TRUE; } - char *end; - errno = 0; - long timer = strtol (value, &end, 10); - if (errno || *end || end == value || timer <= 0 || timer > G_MAXINT) + unsigned long timer; + if (!xstrtoul (&timer, value, 10) || !timer || timer > G_MAXINT) { g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, _("Invalid timer value")); |