The output should probably be captured too just to avoid any possible buffer overflows on the OS.