diff options
author | Guillem Jover <guillem@debian.org> | 2013-11-02 05:30:56 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-11-08 06:44:35 +0100 |
commit | b44d62d91144ba59949613d6725164ea1f2ac9f8 (patch) | |
tree | 6ce3abb9db72ff9870dde122fc1ec8d1cba53474 /dpkg-deb | |
parent | e855e3d679393ee475cf7a88c445912de481bf3e (diff) | |
download | dpkg-b44d62d91144ba59949613d6725164ea1f2ac9f8.tar.gz |
libdpkg: Refactor integer parsing into new dpkg_options_parse_arg_int()
Diffstat (limited to 'dpkg-deb')
-rw-r--r-- | dpkg-deb/main.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index e903ce490..50c80810e 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -189,13 +189,8 @@ static void set_compress_level(const struct cmdinfo *cip, const char *value) { long level; - char *end; - - errno = 0; - level = strtol(value, &end, 0); - if (value == end || *end || errno != 0) - badusage(_("invalid integer for -%c: '%.250s'"), cip->oshort, value); + level = dpkg_options_parse_arg_int(cip, value); if (level < 0 || level > 9) badusage(_("invalid compression level for -%c: %ld'"), cip->oshort, level); |