I have a weird issue with printing data out. I use printf to print a char* string and then after that print another one. However part of the first string doesn't get printed and when I print the second string the missing part of the first one is pretended to that one. What is happening here?
I'm writting a simple libpcap implimentation. Here is a sample callback function that will produce the same results. I tried removing buffering and adding a putchar('\n') after printing but it didn't help.
void ParseData(u_char* useless ,const struct pcap_pkthdr* pkthdr,const u_char* packet){
int packetLen,i;
packetLen = pkthdr->len;
for(i=0;i<packetLen;i++){
putchar(packet[i]);
}
}