buffer overflow fix

Fix for:

buffer overrun in error handler #181

1) strcpy buffer overflow fix
2) compilation warning fix for multiple declarations on single line 
3) modified import to use only strcpy and snprintf
4) added null character at the end of various string buffers