Re: [PATCH 5/6] test-hashmap: simplify alloc_test_entry

2018-02-14 Thread Junio C Hamano
Jeff King writes: > This function takes two ptr/len pairs, which implies that > they can be arbitrary buffers. But internally, it assumes > that each "ptr" is NUL-terminated at "len" (because we > memcpy an extra byte to pick up the NUL terminator). Makes quite a lot of sense.

[PATCH 5/6] test-hashmap: simplify alloc_test_entry

2018-02-14 Thread Jeff King
This function takes two ptr/len pairs, which implies that they can be arbitrary buffers. But internally, it assumes that each "ptr" is NUL-terminated at "len" (because we memcpy an extra byte to pick up the NUL terminator). In practice this works because each caller only ever passes strlen(ptr)