strlen returns the number of characters before the first zero character in a null-terminated C string; it does not report the size of the containing array. section 6.1.5
Use strlen safely by observing these rules:
- Pass an argument that is genuinely zero-terminated; ensuring this is the caller’s responsibility. section 6.1.5
Measuring a program name
A program can compute strlen(argv[0]), allocate a character array of len + 1, and copy the name’s len characters into it. The extra element accommodates the terminating zero.

