mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
fix incorrect loading of files over 8192 bytes
This commit is contained in:
parent
53c14da220
commit
650fdded29
@ -43,7 +43,7 @@ static int read_all_fd_stream(int fd, Buf *out_buf) {
|
||||
buf_resize(out_buf, buf_size);
|
||||
ssize_t actual_buf_len = 0;
|
||||
for (;;) {
|
||||
ssize_t amt_read = read(fd, buf_ptr(out_buf), buf_len(out_buf));
|
||||
ssize_t amt_read = read(fd, buf_ptr(out_buf) + actual_buf_len, buf_size);
|
||||
if (amt_read < 0) {
|
||||
return ErrorFileSystem;
|
||||
}
|
||||
|
||||
@ -878,6 +878,7 @@ void tokenize(Buf *buf, Tokenization *out) {
|
||||
if (digit_value >= 0) {
|
||||
if (digit_value >= t.cur_tok->radix) {
|
||||
tokenize_error(&t, "invalid character: '%c'", c);
|
||||
break;
|
||||
}
|
||||
// normal digit
|
||||
} else {
|
||||
@ -904,6 +905,7 @@ void tokenize(Buf *buf, Tokenization *out) {
|
||||
if (digit_value >= 0) {
|
||||
if (digit_value >= t.cur_tok->radix) {
|
||||
tokenize_error(&t, "invalid character: '%c'", c);
|
||||
break;
|
||||
}
|
||||
// normal digit
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user