ossp-pkg/uuid/uuid_prng.c 1.11 -> 1.12
--- uuid_prng.c 2006/01/13 06:44:31 1.11
+++ uuid_prng.c 2006/07/28 19:16:03 1.12
@@ -48,7 +48,7 @@
int fd = -1;
struct timeval tv;
pid_t pid;
- size_t i;
+ unsigned int i;
/* sanity check argument(s) */
if (prng == NULL)
@@ -68,8 +68,10 @@
}
/* initialize MD5 engine */
- if (md5_create(&((*prng)->md5)) != MD5_RC_OK)
+ if (md5_create(&((*prng)->md5)) != MD5_RC_OK) {
+ free(*prng);
return PRNG_RC_INT;
+ }
/* initialize time resolution compensation counter */
(*prng)->cnt = 0;
@@ -115,7 +117,7 @@
if (prng->dev != -1) {
retries = 0;
while (n > 0) {
- i = read(prng->dev, (void *)p, n);
+ i = (int)read(prng->dev, (void *)p, n);
if (i <= 0) {
if (retries++ > 16)
break;
@@ -159,10 +161,10 @@
/* close PRNG device */
if (prng->dev != -1)
- close(prng->dev);
+ (void)close(prng->dev);
/* destroy MD5 engine */
- md5_destroy(prng->md5);
+ (void)md5_destroy(prng->md5);
/* free object */
free(prng);
|
|