> #define countof(a) (sizeof(a) / sizeof(*(a)))
> #define lengthof(s) (countof(s) - 1)
It makes no sense to use the word "length" to mean one less than the number of items. You could call it maxindexof perhaps.
There may be good arguments for zero based indexing, but we have to also accept that there are downsides. One is that your code has to feature an artificial quantity obtained by subtracting one from a meaningful quantity.