summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c95535b)
(mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
Fixes "pax-big-10g" bug
#include <hash.h>
#include <quotearg.h>
#include <hash.h>
#include <quotearg.h>
static void
atime_decoder (struct tar_stat_info *st, char const *arg)
{
static void
atime_decoder (struct tar_stat_info *st, char const *arg)
{
- st->stat.st_atime = strtoul (arg, NULL, 0);
+ uintmax_t u;
+ if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK)
+ st->stat.st_atime = u;
static void
gid_decoder (struct tar_stat_info *st, char const *arg)
{
static void
gid_decoder (struct tar_stat_info *st, char const *arg)
{
- st->stat.st_gid = strtoul (arg, NULL, 0);
+ uintmax_t u;
+ if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK)
+ st->stat.st_gid = u;
static void
ctime_decoder (struct tar_stat_info *st, char const *arg)
{
static void
ctime_decoder (struct tar_stat_info *st, char const *arg)
{
- st->stat.st_ctime = strtoul (arg, NULL, 0);
+ uintmax_t u;
+ if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK)
+ st->stat.st_ctime = u;
static void
mtime_decoder (struct tar_stat_info *st, char const *arg)
{
static void
mtime_decoder (struct tar_stat_info *st, char const *arg)
{
- st->stat.st_mtime = strtoul (arg, NULL, 0);
+ uintmax_t u;
+ if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK)
+ st->stat.st_mtime = u;
static void
size_decoder (struct tar_stat_info *st, char const *arg)
{
static void
size_decoder (struct tar_stat_info *st, char const *arg)
{
- st->stat.st_size = strtoul (arg, NULL, 0);
+ uintmax_t u;
+ if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK)
+ st->stat.st_size = u;
static void
uid_decoder (struct tar_stat_info *st, char const *arg)
{
static void
uid_decoder (struct tar_stat_info *st, char const *arg)
{
- st->stat.st_uid = strtoul (arg, NULL, 0);
+ uintmax_t u;
+ if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK)
+ st->stat.st_uid = u;