marcotrevisan / mlocate

Forked from mlocate 6 years ago
Clone

5fc996c locate: allocate less space for transliterated, realloc if needed

Authored and Committed by marcotrevisan 6 years ago
1 file changed. 12 lines added. 3 lines removed.
    locate: allocate less space for transliterated, realloc if needed
    
    In case we don't have enough space for the transliterated string
    we can just reallocate some space for it, so far this is just
    needed when chars such as `㎯' are found as they use 4 bytes, but
    the transliteration is 7 bytes. As we can't make assumptions
    about what will be the maximum transliteration length, we can
    just repeatedly reallocate if needed.
    
        
file modified
+12 -3