by ktRolster · 9y ago · 0 comments
strncpy(newBuf, oldBuf, size); newBuf[size-1] = 0;
That way you always end up with a null. It adds the null even when you don't need it, but that's more efficient than adding an 'if' statement.