some bug fixes
This commit is contained in:
parent
65038c9504
commit
6ccfa7ad69
|
@ -733,7 +733,7 @@
|
||||||
(end (if (>= (length opts) 2)
|
(end (if (>= (length opts) 2)
|
||||||
(cadr opts)
|
(cadr opts)
|
||||||
(vector-length v))))
|
(vector-length v))))
|
||||||
(let ((res (make-vector (vector-length v))))
|
(let ((res (make-vector (- end start))))
|
||||||
(vector-copy! res 0 v start end)
|
(vector-copy! res 0 v start end)
|
||||||
res)))
|
res)))
|
||||||
|
|
||||||
|
@ -792,7 +792,7 @@
|
||||||
(end (if (>= (length opts) 2)
|
(end (if (>= (length opts) 2)
|
||||||
(cadr opts)
|
(cadr opts)
|
||||||
(bytevector-length v))))
|
(bytevector-length v))))
|
||||||
(let ((res (make-bytevector (bytevector-length v))))
|
(let ((res (make-bytevector (- end start))))
|
||||||
(bytevector-copy! res 0 v start end)
|
(bytevector-copy! res 0 v start end)
|
||||||
res)))
|
res)))
|
||||||
|
|
||||||
|
|
|
@ -467,12 +467,15 @@ pic_port_read_string(pic_state *pic){
|
||||||
static pic_value
|
static pic_value
|
||||||
pic_port_read_byte(pic_state *pic){
|
pic_port_read_byte(pic_state *pic){
|
||||||
struct pic_port *port = pic_stdin(pic);
|
struct pic_port *port = pic_stdin(pic);
|
||||||
|
char c;
|
||||||
pic_get_args(pic, "|p", &port);
|
pic_get_args(pic, "|p", &port);
|
||||||
|
|
||||||
assert_port_profile(port, PIC_PORT_IN | PIC_PORT_BINARY, PIC_PORT_OPEN, "read-u8");
|
assert_port_profile(port, PIC_PORT_IN | PIC_PORT_BINARY, PIC_PORT_OPEN, "read-u8");
|
||||||
|
if ((c = xfgetc(port->file)) == EOF) {
|
||||||
|
return pic_eof_object();
|
||||||
|
}
|
||||||
|
|
||||||
return pic_int_value((char) xfgetc(port->file));
|
return pic_int_value(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static pic_value
|
static pic_value
|
||||||
|
|
Loading…
Reference in New Issue