implement cmd_fputc