pcap_createsrcstr函数的原型如下:
int pcap_createsrcstr(char *source, int type, const char *host, const char *port, const char *name, char *errbuf);
其中source为存储生成字符串的存储区域的指针。
笔者发现,如果source定义大小为:
char source[PCAP_BUF_SIZE];
函数执行正常。
但是,如果自定义source的大小:
char source[256];
上面的函数就会异常终止。。。。
那么,请问函数对于传入的source的大小是否有特定的要求?