Using linux cryptographic api in busybox

Rich Felker dalias at aerifal.cx
Mon May 9 20:38:46 UTC 2011


On Mon, May 09, 2011 at 09:58:05PM +0200, yuen at klacno.sk wrote:
> const char *alg[] = {
> 	"md5",
> 	"sha1",
> 	"sha224",
> 	"sha256",
> 	"sha384",
> 	"sha512"
> };

This is a very bloated way of doing strings. Note that the pointer
table is not even const! At least use "const char *const alg[]" but
even better would be "const char alg[][7]" or a one-dimensional array
of chars "md5\0sha1\0sha224\0sha256\0sha384\0sha512".

Rich


More information about the busybox mailing list