Fix -O0 builds.

Use snprintf rather than sprintf to avoid Werror failures.
Work around an annotalysis bug when compiling -O0.

Change-Id: Ie7e0a70dbceea5fa85f98262b91bcdbd74fdef1c
4 files changed