Skip to content

Commit

Permalink
fixed handling of fputc
Browse files Browse the repository at this point in the history
  • Loading branch information
simsong committed Feb 16, 2014
1 parent 9abeb43 commit 6cfe1a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tcpip.cpp
Expand Up @@ -264,7 +264,13 @@ void tcpip::print_packet(const u_char *data, uint32_t length)
else if(demux.opt.output_strip_nonprint){
for(const u_char *cc = data;cc<data+length;cc++){
if(isprint(*cc) || (*cc=='\n') || (*cc=='\r')){
written += fputc(*cc,stdout);
int ret = fputc(*cc,stdout);
if(ret==EOF){
std::cerr << "EOF on write to stdout\n";
exit(1);

}
written += ret;
}
}
}
Expand Down

0 comments on commit 6cfe1a4

Please sign in to comment.