[machineid] Drop trailing \n, toInt() doesn't like it

This commit is contained in:
Adriaan de Groot 2019-10-04 18:05:29 +02:00
parent 9e359c98a9
commit 642dbf449c

View File

@ -81,6 +81,10 @@ getUrandomPoolSize()
QByteArray v = f.read( 16 ); QByteArray v = f.read( 16 );
if ( v.length() > 2 ) if ( v.length() > 2 )
{ {
if ( v.endsWith( '\n' ) )
{
v.chop(1);
}
bool ok = false; bool ok = false;
poolSize = v.toInt( &ok ); poolSize = v.toInt( &ok );
if ( !ok ) if ( !ok )
@ -89,7 +93,7 @@ getUrandomPoolSize()
} }
} }
} }
return poolSize >= minimumPoolSize ? poolSize : minimumPoolSize; return (poolSize >= minimumPoolSize) ? poolSize : minimumPoolSize;
} }
Calamares::JobResult Calamares::JobResult