Switch to using built in libc methods.

Signed-off-by: Peter Atashian <retep998@gmail.com>