Cleanup uses of sprintf, add modes to open() with O_CREAT.

Change-Id: Iaed2538831b19ada26005bbef33cff28209c6512
6 files changed