Adhered to C89 standard. termprint() now works great in the application.