fixing bug #61 in string ports > 1024 chars (thanks tizoc)

This commit is contained in:
Alex Shinn 2011-02-27 18:00:46 +09:00
parent 208819a4e4
commit ece6500f99

2
sexp.c
View file

@ -1014,7 +1014,7 @@ int sstream_read (void *vec, char *dst, int n) {
if (pos >= len) return 0; if (pos >= len) return 0;
if (n > (len - pos)) n = (len - pos); if (n > (len - pos)) n = (len - pos);
memcpy(dst, sexp_string_data(sexp_stream_buf(vec))+pos, n); memcpy(dst, sexp_string_data(sexp_stream_buf(vec))+pos, n);
sexp_stream_pos_set(vec, sexp_make_fixnum(n)); sexp_stream_pos_set(vec, sexp_make_fixnum(pos + n));
return n; return n;
} }