* A small program to generate the ASCII form of a capture with TCP
* segments of a reasonable nature. The payload is all zeros.
*
- * $Id: mkcap.c,v 1.1 2003/10/05 05:04:32 sharpe Exp $
+ * $Id$
*
* By Ronnie Sahlberg and Richard Sharpe. From a program initially
* written by Ronnie.
fprintf(stderr, "Strange drop list. NULL or an empty string. No drops!\n");
return;
}
- save = (char *)strdup(drop_list);
+ save = (char *)g_strdup(drop_list);
for (tok=(char *)strtok(drop_list, ","); tok; tok=(char *)strtok(NULL, ",")) {
commas++;
/* Now, we have commas, divide by two and round up */
seg_drop_count = (commas+1)/2;
- drops = (seg_drop_t *)malloc(sizeof(seg_drop_t) * seg_drop_count);
+ drops = (seg_drop_t *)g_malloc(sizeof(seg_drop_t) * seg_drop_count);
if (!drops) {
fprintf(stderr, "Unable to allocate space for drops ... going without!\n");
seg_drop_count = 0;
- free(save);
+ g_free(save);
return;
}
fprintf(stderr, "Error in segment offset or count. Not all digits: %s\n",
tok);
fprintf(stderr, "No packet drops being performed!\n");
- free(save);
- free(drops);
+ g_free(save);
+ g_free(drops);
seg_drop_count = 0; drops = NULL;
return;
}