Use fprintf instead of fputs

I thought fputs would add newlines, but it's not.