fill_hashes: accept zero-terminated string

The same as the rest of the scripts.