The problem with the truncation of the output window was due to using the cprintf function. Changing all cprintf to printf resolved the issue.