I have a buffer, I am doing lot of strncat. I want to make sure I never overflow the buffer size.
char buff[64];
strcpy(buff, "String 1");
strncat(buff, "String 2", sizeof(buff));
strncat(buff, "String 3", sizeof(buff));
Instead of sizeof(buff), I want to say something buff - xxx. I want to make sure I never override the buffer