Sync with r21-2-26.
[chise/xemacs-chise.git-] / src / md5.c
index 2b204ff..775942a 100644 (file)
--- a/src/md5.c
+++ b/src/md5.c
 #endif
 
 #include <sys/types.h>
-
-#include <stdlib.h>
 #include <string.h>
-
 #include <stdio.h>
 
 #if defined HAVE_LIMITS_H || _LIBC
@@ -566,7 +563,7 @@ file-coding or Mule support.  Otherwise, they are ignored.
       CHECK_STRING (object);
       get_string_range_byte (object, start, end, &bstart, &bend,
                             GB_HISTORICAL_STRING_BEHAVIOR);
-      instream = make_lisp_string_input_stream (object, bstart, bend);
+      instream = make_lisp_string_input_stream (object, bstart, bend - bstart);
     }
   GCPRO1 (instream);
 
@@ -585,8 +582,8 @@ file-coding or Mule support.  Otherwise, they are ignored.
   while (1)
     {
       Bufbyte tempbuf[1024];   /* some random amount */
-      int size_in_bytes = Lstream_read (XLSTREAM (instream),
-                                       tempbuf, sizeof (tempbuf));
+      ssize_t size_in_bytes =
+       Lstream_read (XLSTREAM (instream), tempbuf, sizeof (tempbuf));
       if (!size_in_bytes)
        break;