#endif
#include <sys/types.h>
-
-#include <stdlib.h>
#include <string.h>
-
#include <stdio.h>
#if defined HAVE_LIMITS_H || _LIBC
{
/* Attempt to autodetect the coding of the string. This is
VERY hit-and-miss. */
- enum eol_type eol = EOL_AUTODETECT;
+ eol_type_t eol = EOL_AUTODETECT;
coding_system = Fget_coding_system (Qundecided);
determine_real_coding_system (XLSTREAM (istream),
&coding_system, &eol);
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);
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;