MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / readLonglink

Function readLonglink

launcher/Untar.cpp:90–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88// };
89
90bool readLonglink(QIODevice* in, qint64 size, QByteArray& longlink)
91{
92 qint64 n = 0;
93 size--; // ignore trailing null
94 if (size < 0) {
95 qCritical() << "The filename size is negative";
96 return false;
97 }
98 longlink.resize(size + (BLOCKSIZE - size % BLOCKSIZE)); // make the size divisible by BLOCKSIZE
99 for (qint64 offset = 0; offset < longlink.size(); offset += BLOCKSIZE) {
100 n = in->read(longlink.data() + offset, BLOCKSIZE);
101 if (n != BLOCKSIZE) {
102 qCritical() << "The expected blocksize was not respected for the name";
103 return false;
104 }
105 }
106 longlink.truncate(qstrlen(longlink.constData()));
107 return true;
108}
109
110int getOctal(char* buffer, int maxlenght, bool* ok)
111{

Callers 1

extractMethod · 0.85

Calls 4

resizeMethod · 0.80
sizeMethod · 0.45
readMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected