# HG changeset patch # User Paul Boddie # Date 1481056018 -3600 # Node ID aa10eecbc8ce350f4ad5057b2689bd04277b00f1 # Parent 575115c7ce7391311e56e2f9589ce0c81fbaa361 Fixed the buffer declaration in the read function. diff -r 575115c7ce73 -r aa10eecbc8ce templates/native.c --- a/templates/native.c Tue Dec 06 20:35:50 2016 +0100 +++ b/templates/native.c Tue Dec 06 21:26:58 2016 +0100 @@ -664,6 +664,9 @@ if (f == NULL) __raise_io_error(__new_int(errno)); + + /* Return the __data__ attribute. */ + else { attr.context = 0; @@ -680,7 +683,7 @@ int i = __load_via_object(fd->value, __pos___data__).intvalue; /* n.__data__ interpreted as int */ int to_read = __load_via_object(n->value, __pos___data__).intvalue; - void *buf[to_read + 1]; + void buf[to_read]; ssize_t have_read; char *s;