diff options
Diffstat (limited to 'src/libutil/tarfile.cc')
-rw-r--r-- | src/libutil/tarfile.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc index c7f9499fd..316751533 100644 --- a/src/libutil/tarfile.cc +++ b/src/libutil/tarfile.cc @@ -1,6 +1,7 @@ #include <archive.h> #include <archive_entry.h> +#include "charptr-cast.hh" #include "file-system.hh" #include "logging.hh" #include "serialise.hh" @@ -15,11 +16,11 @@ static int callback_open(struct archive *, void * self) static ssize_t callback_read(struct archive * archive, void * _self, const void * * buffer) { - auto self = (TarArchive *) _self; + auto self = static_cast<TarArchive *>(_self); *buffer = self->buffer.data(); try { - return self->source->read((char *) self->buffer.data(), self->buffer.size()); + return self->source->read(charptr_cast<char *>(self->buffer.data()), self->buffer.size()); } catch (EndOfFile &) { return 0; } catch (std::exception & err) { |