Unused variables removed
Reducing scope
Preincrement/decrement instead of postincrement/decrement
C style pointer casting
strncpy() NULL terminated
sscanf() - size of BUF
Unused variables removed