Some static code analyzer tools are suggesting that all strcat usage should be replaced with strncat for safety purpose?
In a program, if we know clearly the size of the target buffer and source buffers, is it still recommended to go for strncat?
Also, given the suggestions by static tools, should strcat be used ever?
If you are absolutely sure about source buffer’s size and that the source buffer contains a NULL-character terminating the string, then you can safely use strcat when the destination buffer is large enough.
I still recommend using strncat and give it the size of the destination buffer – length of the destination string – 1
Note: I edited this since comments noted that my previous answer was horribly wrong.