aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
authormartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>2008-01-24 17:14:01 +0000
committermartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>2008-01-24 17:14:01 +0000
commit2d606b36c8520910b504dc0ca0bbef4ec57cdcbc (patch)
tree531a55779f843c6319c57b75953fd88405715d64 /editcap.c
parent194f23dc1167b7265d8411c942c7374322e410a5 (diff)
Replace a handful of tabs with spaces.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24176 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/editcap.c b/editcap.c
index de86cf6d4d..c7ec2d7147 100644
--- a/editcap.c
+++ b/editcap.c
@@ -620,7 +620,7 @@ int main(int argc, char *argv[])
if (split_packet_count > 0) {
filename = (char *) malloc(strlen(argv[optind+1]) + 20);
if (!filename) {
- exit(5);
+ exit(5);
}
sprintf(filename, "%s-%05d", argv[optind+1], 0);
} else {
@@ -628,44 +628,43 @@ int main(int argc, char *argv[])
}
pdh = wtap_dump_open(filename, out_file_type,
- out_frame_type, wtap_snapshot_length(wth), FALSE /* compressed */, &err);
+ out_frame_type, wtap_snapshot_length(wth),
+ FALSE /* compressed */, &err);
if (pdh == NULL) {
fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename,
wtap_strerror(err));
exit(1);
-
}
for (i = optind + 2; i < argc; i++)
if (add_selection(argv[i]) == FALSE)
- break;
+ break;
while (wtap_read(wth, &err, &err_info, &data_offset)) {
if (split_packet_count > 0 && (written_count % split_packet_count == 0)) {
- if (!wtap_dump_close(pdh, &err)) {
-
- fprintf(stderr, "editcap: Error writing to %s: %s\n", filename,
- wtap_strerror(err));
- exit(1);
- }
+ if (!wtap_dump_close(pdh, &err)) {
- sprintf(filename, "%s-%05d",argv[optind+1], count / split_packet_count);
+ fprintf(stderr, "editcap: Error writing to %s: %s\n", filename,
+ wtap_strerror(err));
+ exit(1);
+ }
- if (verbose) {
- fprintf(stderr, "Continuing writing in file %s\n", filename);
- }
+ sprintf(filename, "%s-%05d",argv[optind+1], count / split_packet_count);
- pdh = wtap_dump_open(filename, out_file_type,
- out_frame_type, wtap_snapshot_length(wth), FALSE /* compressed */, &err);
- if (pdh == NULL) {
+ if (verbose) {
+ fprintf(stderr, "Continuing writing in file %s\n", filename);
+ }
- fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename,
- wtap_strerror(err));
- exit(1);
+ pdh = wtap_dump_open(filename, out_file_type,
+ out_frame_type, wtap_snapshot_length(wth), FALSE /* compressed */, &err);
+ if (pdh == NULL) {
- }
+ fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename,
+ wtap_strerror(err));
+ exit(1);
+ }
}
check_ts = check_timestamp(wth);
@@ -726,16 +725,17 @@ int main(int argc, char *argv[])
phdr = &snap_phdr;
}
- if (dup_detect) {
- buf = wtap_buf_ptr(wth);
- if (is_duplicate(buf, phdr->caplen)) {
+ if (dup_detect) {
+ buf = wtap_buf_ptr(wth);
+ if (is_duplicate(buf, phdr->caplen)) {
if (verbose)
printf("Skipping duplicate: %u\n", count);
count++;
- continue;
+ continue;
}
- }
+ }
+ /* Random error mutation */
if (err_prob > 0.0) {
buf = wtap_buf_ptr(wth);
for (i = 0; i < (int) phdr->caplen; i++) {
@@ -788,9 +788,9 @@ int main(int argc, char *argv[])
filename, wtap_strerror(err));
exit(1);
- }
+ }
- written_count++;
+ written_count++;
}
@@ -808,8 +808,8 @@ int main(int argc, char *argv[])
case WTAP_ERR_UNSUPPORTED:
case WTAP_ERR_UNSUPPORTED_ENCAP:
case WTAP_ERR_BAD_RECORD:
- fprintf(stderr, "(%s)\n", err_info);
- break;
+ fprintf(stderr, "(%s)\n", err_info);
+ break;
}
}