diff --git a/Makefile b/Makefile index 74d7709..a513f9c 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,9 @@ CHECKDATA=testdata/db/v0/data.mdb all: $(BIN) lib bench -%.o: %.c $(HEADERS) +$(OBJS): $(HEADERS) + +%.o: %.c $(CC) $(CFLAGS) -c -o $@ $< libnostrdb.a: $(OBJS) diff --git a/src/content_parser.c b/src/content_parser.c index c302a45..753880b 100644 --- a/src/content_parser.c +++ b/src/content_parser.c @@ -91,8 +91,8 @@ static int parse_hashtag(struct cursor *cur, struct ndb_block *block) { // // bech32 blocks are stored as: // -// nostr_bech32_type : varint // bech32_buffer_size : u16 +// nostr_bech32_type : varint // bech32_data : [u8] // // The TLV form is compact already, so we just use it directly diff --git a/src/nostrdb.c b/src/nostrdb.c index e4686a5..a0d0136 100644 --- a/src/nostrdb.c +++ b/src/nostrdb.c @@ -5071,7 +5071,7 @@ static inline int ndb_builder_find_str(struct ndb_builder *builder, uint32_t index = ((uint32_t*)builder->str_indices.start)[i]; const char *some_str = (const char*)builder->strings.start + index; - if (!memcmp(some_str, str, len)) { + if (!memcmp(some_str, str, len) && some_str[len] == '\0') { // found an existing matching str, use that index *pstr = ndb_offset_str(index); return 1;