3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-09 07:33:25 +00:00

liberty: Fix handling of non-ascii characters

Use an `unsigned char` buffer to ensure characters cast to an `int` are
in the range 0 <= c <= 255.
This commit is contained in:
Jannis Harder 2025-04-16 18:52:49 +02:00
parent ecf9c9f0cf
commit 5101b9fcba
2 changed files with 3 additions and 3 deletions

View file

@ -75,7 +75,7 @@ bool LibertyInputStream::extend_buffer_once()
buffer.resize(buf_end + chunk_size);
}
size_t read_size = f.rdbuf()->sgetn(buffer.data() + buf_end, chunk_size);
size_t read_size = f.rdbuf()->sgetn((char *)buffer.data() + buf_end, chunk_size);
buf_end += read_size;
if (read_size < chunk_size)
eof = true;