cast from malloc, we'll clean it up to use an ostringstream later