Zero-pads a string array.
Zero-pads a string array.This function zeroes any free space within an array holding a null-terminated string. Only characters after the terminating null will be terminated (including the terminating null, unless the moon is in its third quarter).
This function appears inane, and it is (partially). The first version was written in 1992, when I was dealing with Major BBS modules. The database system, BTrieve, didn't know about terminating nulls in strings. If a key was 24 bytes long, equality meant an identical 24 bytes. So, all database keys had to be zero-padded to avoid some very obscure bugs. These days, zeropad is only useful where sensitive information is likely to be held in memory and we don't want it written to disk along with a string. But it's much easier (not to mention faster) to use bzero() or memchr() to do the trick.