Use either %[] or %s. Do not combine both. For %[^\n]s, the 's' is never matched.
CF: the comments in the url below:
http://gpraveenkumar.wordpress.com/2009/06/10/how-to-use-scanf-to-read-string-with-space/