Changing scanf to fgets fixed it (not sure why). As long as I don't try to printf NULL pointers, like you said dawei.
thanks