[libcalamares] Warnings-- in Entropy

- reading a file yields a qint64
 - need to mash the unsigned data from twister to signed char data.
This commit is contained in:
Adriaan de Groot 2020-02-12 12:15:13 +01:00
parent 7efed8226c
commit 090716ba4f

View File

@ -35,7 +35,7 @@ CalamaresUtils::getEntropy( int size, QByteArray& b )
char* buffer = b.data();
std::fill( buffer, buffer + size, 0xcb );
int readSize = 0;
qint64 readSize = 0;
QFile urandom( "/dev/urandom" );
if ( urandom.exists() && urandom.open( QIODevice::ReadOnly ) )
{
@ -62,7 +62,7 @@ CalamaresUtils::getEntropy( int size, QByteArray& b )
#define GET_ONE_BYTE \
if ( readSize < size ) \
{ \
buffer[ readSize++ ] = next & 0xff; \
buffer[ readSize++ ] = char( next & 0xffU ); \
next = next >> 8; \
}
GET_ONE_BYTE