some compilers don't like the void* arithmetic

This commit is contained in:
mcgreer%netscape.com 2000-07-20 16:58:32 +00:00
Родитель 869e91a492
Коммит 4d5a2e1aca
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -31,7 +31,7 @@
* may use your version of this file under either the MPL or the
* GPL.
*
* $Id: prng_fips1861.c,v 1.2 2000-07-19 23:54:43 mcgreer%netscape.com Exp $
* $Id: prng_fips1861.c,v 1.3 2000-07-20 16:58:32 mcgreer%netscape.com Exp $
*/
#include "prerr.h"
@ -358,6 +358,7 @@ prng_GenerateGlobalRandomBytes(RNGContext *rng,
{
PRUint8 num;
SECStatus rv;
unsigned char *output = dest;
/* check for a valid global RNG context */
PORT_Assert(rng != NULL);
if (rng == NULL) {
@ -386,10 +387,10 @@ prng_GenerateGlobalRandomBytes(RNGContext *rng,
/* number of bytes to obtain on this iteration (max of 20) */
num = PR_MIN(rng->avail, len);
/* if avail < BSIZE, the first avail bytes have already been used. */
memcpy(dest, rng->Xj + (BSIZE - rng->avail), num);
memcpy(output, rng->Xj + (BSIZE - rng->avail), num);
rng->avail -= num;
len -= num;
dest += num;
output += num;
}
PR_Unlock(rng->lock);
/* --- UNLOCKED --- */