mirror of
https://github.com/rui314/mold.git
synced 2024-09-11 21:17:28 +03:00
Fix -Wdeprecated-declarations
This commit is contained in:
parent
bd555b33ab
commit
c9ff2a21c5
4
tar.cc
4
tar.cc
@ -77,7 +77,7 @@ void TarWriter::append(std::string path, std::string_view data) {
|
||||
UstarHeader pax;
|
||||
|
||||
std::string attr = encode_path(basedir, path);
|
||||
sprintf(pax.size, "%011zo", attr.size());
|
||||
snprintf(pax.size, sizeof(pax.size), "%011zo", attr.size());
|
||||
pax.typeflag[0] = 'x';
|
||||
pax.finalize();
|
||||
fwrite(&pax, sizeof(pax), 1, out);
|
||||
@ -89,7 +89,7 @@ void TarWriter::append(std::string path, std::string_view data) {
|
||||
// Write Ustar header
|
||||
UstarHeader ustar;
|
||||
memcpy(ustar.mode, "0000664", 8);
|
||||
sprintf(ustar.size, "%011zo", data.size());
|
||||
snprintf(ustar.size, sizeof(ustar.size), "%011zo", data.size());
|
||||
ustar.finalize();
|
||||
fwrite(&ustar, sizeof(ustar), 1, out);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user