Added check for scanw, fixed #222
fixed do/while loop, as per coding standards
Added endwin() before exit()
Merge remote-tracking branch 'sarvsav/scanwNULLfix' into develop