authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-01-28 22:38:18-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-01-28 22:38:18-07:00
log650fdded29da7d1e741d17c8a15c93c511266547
tree2f09439ebc4ad95afc3f6c7db2f7d90e6dbae931
parent53c14da2206c74783acb792eab6085cc7d06f068

fix incorrect loading of files over 8192 bytes


2 files changed, 3 insertions(+), 1 deletions(-)

src/os.cpp+1-1
......@@ -43,7 +43,7 @@ static int read_all_fd_stream(int fd, Buf *out_buf) {
4343 buf_resize(out_buf, buf_size);
4444 ssize_t actual_buf_len = 0;
4545 for (;;) {
46 ssize_t amt_read = read(fd, buf_ptr(out_buf), buf_len(out_buf));
46 ssize_t amt_read = read(fd, buf_ptr(out_buf) + actual_buf_len, buf_size);
4747 if (amt_read < 0) {
4848 return ErrorFileSystem;
4949 }
src/tokenizer.cpp+2
......@@ -878,6 +878,7 @@ void tokenize(Buf *buf, Tokenization *out) {
878878 if (digit_value >= 0) {
879879 if (digit_value >= t.cur_tok->radix) {
880880 tokenize_error(&t, "invalid character: '%c'", c);
881 break;
881882 }
882883 // normal digit
883884 } else {
......@@ -904,6 +905,7 @@ void tokenize(Buf *buf, Tokenization *out) {
904905 if (digit_value >= 0) {
905906 if (digit_value >= t.cur_tok->radix) {
906907 tokenize_error(&t, "invalid character: '%c'", c);
908 break;
907909 }
908910 // normal digit
909911 } else {