mirror of
https://github.com/mirror/make.git
synced 2024-12-28 05:40:10 +08:00
* src/arscan.c (ar_member_touch): [SV 54533] Stop \0 in archive headers
This commit is contained in:
parent
5d6508a475
commit
214865ed5c
@ -904,14 +904,12 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
EINTRLOOP (r, fstat (fd, &statbuf));
|
||||
if (r < 0)
|
||||
goto lose;
|
||||
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
||||
/* Advance member's time to that time */
|
||||
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
||||
for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)
|
||||
ar_hdr.ar_date[ui] = ' ';
|
||||
sprintf (TOCHAR (ar_hdr.ar_date), "%lu", (long unsigned) statbuf.st_mtime);
|
||||
#ifdef AIAMAG
|
||||
ar_hdr.ar_date[strlen (ar_hdr.ar_date)] = ' ';
|
||||
#endif
|
||||
#else
|
||||
ar_hdr.ar_date = statbuf.st_mtime;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user