Skip to content

Commit

Permalink
hash: Improve flb_hash_add to take key up to key_length
Browse files Browse the repository at this point in the history
Signed-off-by: I330716 <[email protected]>
  • Loading branch information
vlvasilev committed Mar 14, 2019
1 parent 881ca2a commit e8417bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flb_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int flb_hash_add(struct flb_hash *ht, char *key, int key_len,
entry->hits = 0;

/* Store the key and value as a new memory region */
entry->key = flb_strdup(key);
entry->key = flb_strndup(key, key_len);
entry->key_len = key_len;
entry->val = flb_malloc(val_size + 1);
if (!entry->val) {
Expand Down

0 comments on commit e8417bf

Please sign in to comment.