gpg: Factor some code code out of tofu.c
authorWerner Koch <wk@gnupg.org>
Fri, 29 Apr 2016 13:41:10 +0000 (15:41 +0200)
committerWerner Koch <wk@gnupg.org>
Fri, 29 Apr 2016 13:41:10 +0000 (15:41 +0200)
commitdcad99c98616a6031ddfde313c920339e4012378
tree0900165f4e63a909184d87ff2400d46013041b4a
parent300b227cf457deb918f25bcece0d734b61ae1348
gpg: Factor some code code out of tofu.c

* g10/tofu.c (string_to_long): New.
(string_to_ulong): New.
(get_single_unsigned_long_cb): Replace strtol/strtoul by new function.
(get_single_long_cb): Ditto.
(signature_stats_collect_cb):  Ditto.
(get_policy): Ditto.
(show_statistics): Ditto.  Uese es_free instead of free.
--

There is one minor semantic change: We now accept "nnn.0" always.  The
old code did not checked for ".0: in show_statistics.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/tofu.c