Ported from libnbcompat by Gautam Tirumala
- split sprintf() and snprintf() to solve a linking problem when compiling an application