tar: prefer stoint to strtoul and variants.
When parsing numbers prefer using strtosysint() (renamed stoint)
to using strtoul() and its variants.
This is simpler and faster and likely more reliable than
relying on quirks of the system strtoul() etc,
and it standardizes how tar deals with parsing integers.
Among other things, the C standard and POSIX don't specify
what strtol() does to errno when conversions cannot be performed,
and it requires strtoul() to support "-" before unsigned numbers.
* (stoint): rename from strtosysint, move to tar-internal.c and add
a gboollean * argument for reporting overflow. All callers changed.
* (decode_num): prefer stoint() to strtol() etc. Don't rely on
errno == EINVAL as the standards don't guarantee it.
* (decode_signed_num): likewise.
* (decode_record): likewise.
* (sparse_map_decoder): likewise.
* (decode_timespec): Simplify by using ckd_sub() rather than checking
for overflow by hand.
* tar-sparse.c: remove include of errno.h, it's no lomger used.
* tar-xheader.c: likewise
Sync with GNU tar
d1e72a536f26188230a147d948b9057714fd0b6b.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>