| 20 |
|
|
| 21 |
#include <hash.h> |
#include <hash.h> |
| 22 |
#include <quotearg.h> |
#include <quotearg.h> |
| 23 |
|
#include <xstrtol.h> |
| 24 |
|
|
| 25 |
#include "common.h" |
#include "common.h" |
| 26 |
|
|
| 291 |
static void |
static void |
| 292 |
atime_decoder (struct tar_stat_info *st, char const *arg) |
atime_decoder (struct tar_stat_info *st, char const *arg) |
| 293 |
{ |
{ |
| 294 |
st->stat.st_atime = strtoul (arg, NULL, 0); |
uintmax_t u; |
| 295 |
|
if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK) |
| 296 |
|
st->stat.st_atime = u; |
| 297 |
} |
} |
| 298 |
|
|
| 299 |
static void |
static void |
| 306 |
static void |
static void |
| 307 |
gid_decoder (struct tar_stat_info *st, char const *arg) |
gid_decoder (struct tar_stat_info *st, char const *arg) |
| 308 |
{ |
{ |
| 309 |
st->stat.st_gid = strtoul (arg, NULL, 0); |
uintmax_t u; |
| 310 |
|
if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK) |
| 311 |
|
st->stat.st_gid = u; |
| 312 |
} |
} |
| 313 |
|
|
| 314 |
static void |
static void |
| 347 |
static void |
static void |
| 348 |
ctime_decoder (struct tar_stat_info *st, char const *arg) |
ctime_decoder (struct tar_stat_info *st, char const *arg) |
| 349 |
{ |
{ |
| 350 |
st->stat.st_ctime = strtoul (arg, NULL, 0); |
uintmax_t u; |
| 351 |
|
if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK) |
| 352 |
|
st->stat.st_ctime = u; |
| 353 |
} |
} |
| 354 |
|
|
| 355 |
static void |
static void |
| 362 |
static void |
static void |
| 363 |
mtime_decoder (struct tar_stat_info *st, char const *arg) |
mtime_decoder (struct tar_stat_info *st, char const *arg) |
| 364 |
{ |
{ |
| 365 |
st->stat.st_mtime = strtoul (arg, NULL, 0); |
uintmax_t u; |
| 366 |
|
if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK) |
| 367 |
|
st->stat.st_mtime = u; |
| 368 |
} |
} |
| 369 |
|
|
| 370 |
static void |
static void |
| 392 |
static void |
static void |
| 393 |
size_decoder (struct tar_stat_info *st, char const *arg) |
size_decoder (struct tar_stat_info *st, char const *arg) |
| 394 |
{ |
{ |
| 395 |
st->stat.st_size = strtoul (arg, NULL, 0); |
uintmax_t u; |
| 396 |
|
if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK) |
| 397 |
|
st->stat.st_size = u; |
| 398 |
} |
} |
| 399 |
|
|
| 400 |
static void |
static void |
| 407 |
static void |
static void |
| 408 |
uid_decoder (struct tar_stat_info *st, char const *arg) |
uid_decoder (struct tar_stat_info *st, char const *arg) |
| 409 |
{ |
{ |
| 410 |
st->stat.st_uid = strtoul (arg, NULL, 0); |
uintmax_t u; |
| 411 |
|
if (xstrtoumax (arg, 0, 10, &u, "") == LONGINT_OK) |
| 412 |
|
st->stat.st_uid = u; |
| 413 |
} |
} |
| 414 |
|
|
| 415 |
static void |
static void |