Skip to content

Commit 1be01a7

Browse files
lauris71metsma
andauthored
Apply suggestions from code review
Co-authored-by: Raul Metsma <raul@metsma.ee>
1 parent 04fd236 commit 1be01a7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cdoc/Tar.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,14 @@ libcdoc::result_t
297297
libcdoc::TarSource::readPaxHeader(const Header& hdr, std::string& name, int64_t& size)
298298
{
299299
int64_t h_size = hdr.getSize();
300-
std::vector<char> pax_in(h_size);
301-
result_t result = _src->read((uint8_t *) pax_in.data(), pax_in.size());
300+
std::string paxData(h_size, 0);
301+
result_t result = _src->read((uint8_t *) paxData.data(), paxData.size());
302302
if (result != h_size) {
303303
_error = INPUT_STREAM_ERROR;
304304
return _error;
305305
}
306-
std::string paxData(pax_in.data(), pax_in.size());
307306
_src->skip(padding(h_size));
308307
// Parse Pax data
309-
std::stringstream ss(paxData);
310308
for(const std::string &data: split(paxData, '\n')) {
311309
if(data.empty()) break;
312310
size_t eq_pos = data.find_first_of('=');

0 commit comments

Comments
 (0)