Fix a number of security issues found by Clang SA 3.0 thanks to additions made by me. :)
Fix a number of security issues found by Clang SA 3.0 thanks to additions made by me. :)

Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strncat'. CWE-119

Instead of using strcat and strcpy, switch to snprintf().

ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead