Unused Variables Removed
Prefer Preincrement/Decrement
sscanf() to prevent overflow
strncpy() '\0' terminated
C style pointer casting
Reducing the scope of variables
Merge pull request #247 from stepcode/ks/CPPcheck

Ks/cppcheck - fix some of the problems reported by cppcheck