/[tar]/tar/src/xheader.c
ViewVC logotype

Diff of /tar/src/xheader.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by eggert, Wed Nov 5 01:33:36 2003 UTC revision 1.10 by gray, Thu Nov 13 08:47:25 2003 UTC
# Line 20  Line 20 
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    
# Line 290  atime_coder (struct tar_stat_info const Line 291  atime_coder (struct tar_stat_info const
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
# Line 303  gid_coder (struct tar_stat_info const *s Line 306  gid_coder (struct tar_stat_info const *s
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
# Line 342  ctime_coder (struct tar_stat_info const Line 347  ctime_coder (struct tar_stat_info const
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
# Line 355  mtime_coder (struct tar_stat_info const Line 362  mtime_coder (struct tar_stat_info const
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
# Line 383  size_coder (struct tar_stat_info const * Line 392  size_coder (struct tar_stat_info const *
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
# Line 396  uid_coder (struct tar_stat_info const *s Line 407  uid_coder (struct tar_stat_info const *s
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

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26