Updated code to use modern safe idiomatic C++.

Signed-off-by: retep998 <retep998@verizon.net>