sprintf appears to be outputting to stout as side effect?