fixed incompatibility with system getline()
fix illegal memory access
fix double character
Fix memory corruption as of issue #2
Merge branch 'master' into listing