fix #15: return actual bytes written from readData()

This commit is contained in:
Manuel Domke
2019-01-13 18:02:54 +01:00
parent 857cfab940
commit 154fe4a67c

View File

@@ -337,7 +337,7 @@ uint32_t readData(struct infnoise_context *context, uint8_t *result, bool raw, u
context->bytesWritten += bytesToWrite;
context->numBits -= bytesToWrite * 8u;
return 1024/8u;
return bytesToWrite;
} else { // collect new entropy
uint8_t inBuf[BUFLEN];
struct timespec start;