diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:29 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:29 -0800 |
commit | 302e3218b7d487539ec305bf23881a6ee7d5be99 (patch) | |
tree | bf1adafe552a17b3b78522048bb7c24787696dd3 /byte.c | |
parent | c7d035ae1a729232579a0fe41ed5affa131d3623 (diff) | |
download | scm-302e3218b7d487539ec305bf23881a6ee7d5be99.tar.gz scm-302e3218b7d487539ec305bf23881a6ee7d5be99.zip |
Import Upstream version 5e1upstream/5e1
Diffstat (limited to 'byte.c')
-rw-r--r-- | byte.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -119,7 +119,7 @@ SCM scm_bytes_reverse(str) ASRTER(NIMP(str) && STRINGP(str), str, ARG1, s_bt_reverse); len = LENGTH(str); dst = CHARS(str); - for(k = len/2;k >= 0;k--) { + for(k = (len - 1)/2;k >= 0;k--) { int tmp = dst[k]; dst[k] = dst[len - k - 1]; dst[len - k - 1] = tmp; @@ -187,7 +187,7 @@ SCM scm_substring_read(sstr, start, args) } else { long idx = start; - while (end <= idx) { + while (end < idx) { int chr = lgetc(port); if (EOF==chr) return MAKINUM(start - idx); CHARS(sstr)[--idx] = chr; |