[darwinbuild-changes] [597] trunk/darwinbuild/manifest.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 12 16:00:31 PDT 2009


Revision: 597
          http://trac.macosforge.org/projects/darwinbuild/changeset/597
Author:   wsiegrist at apple.com
Date:     2009-10-12 16:00:28 -0700 (Mon, 12 Oct 2009)
Log Message:
-----------
Use ssize_t for reading since read() can return negative values.

Modified Paths:
--------------
    trunk/darwinbuild/manifest.c

Modified: trunk/darwinbuild/manifest.c
===================================================================
--- trunk/darwinbuild/manifest.c	2009-10-12 22:40:21 UTC (rev 596)
+++ trunk/darwinbuild/manifest.c	2009-10-12 23:00:28 UTC (rev 597)
@@ -77,7 +77,7 @@
 
 	EVP_DigestInit(&ctx, md);
 
-	unsigned int len;
+	ssize_t len;
 	const unsigned int blocklen = 8192;
 	static unsigned char* block = NULL;
 	if (block == NULL) {
@@ -88,10 +88,10 @@
 		if (len == 0) { close(fd); break; }
 		if ((len < 0) && (errno == EINTR)) continue;
 		if (len < 0) { close(fd); return NULL; }
-		EVP_DigestUpdate(&ctx, block, len);
+		EVP_DigestUpdate(&ctx, block, (size_t)len);
 	}
 
-	EVP_DigestFinal(&ctx, digstr, &len);
+	EVP_DigestFinal(&ctx, digstr, NULL);
 	return format_digest(digstr);
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20091012/3a7da949/attachment.html>


More information about the darwinbuild-changes mailing list