Compare commits

...

2 Commits

Author SHA1 Message Date
Mid
8b0fbfdcf7 Create Makefile.. finally 2025-10-07 11:00:39 +03:00
Mid
75c0ac1997 Bugfix 2025-10-07 10:57:38 +03:00
2 changed files with 9 additions and 1 deletions

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
libeebie.so:
$(CC) -shared -g -O2 -o libeebie.so eebie/reader.c eebie/writer.c
install:
install -d /usr/local/include/eebie
install eebie/*.h /usr/local/include/eebie
install libeebie.so /usr/local/lib

View File

@ -32,7 +32,8 @@ static int bit_length(uint64_t i) {
}
static uint64_t encode_int(uint64_t i) {
return i | VARINT_MASKS[(bit_length(i) + 6) / 7];
// bit_length(i + 1) over bit_length(i) because 0xFF... lengths are interpreted as indefinite
return i | VARINT_MASKS[(bit_length(i + 1) + 6) / 7];
}
static void advance(EBMLWriter *this, uint64_t amount) {