aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/vms.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-10-06 22:01:12 -0700
committerGuy Harris <guy@alum.mit.edu>2014-10-07 05:01:39 +0000
commitffd48cefa6c468d4cdadd5e562f0d3c63eb4a2d6 (patch)
tree58061a0a150ff180c840de7776c78cf02fd97490 /wiretap/vms.c
parent683d657d4977487c073777f156938d6970e2f08b (diff)
Whitespace cleanups.
Change-Id: I92f983b2e04defab30eb31c14c484b9f0f582413 Reviewed-on: https://code.wireshark.org/review/4513 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/vms.c')
-rw-r--r--wiretap/vms.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/wiretap/vms.c b/wiretap/vms.c
index 61a3fc1d32..28c0e5df4e 100644
--- a/wiretap/vms.c
+++ b/wiretap/vms.c
@@ -358,45 +358,45 @@ parse_vms_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gch
/* First look for the Format 1 type sequencing */
num_items_scanned = sscanf(p,
- "packet %9d at %2d-%3s-%4d %2d:%2d:%2d.%9d",
- &pktnum, &tm.tm_mday, mon,
+ "packet %9d at %2d-%3s-%4d %2d:%2d:%2d.%9d",
+ &pktnum, &tm.tm_mday, mon,
&tm.tm_year, &tm.tm_hour,
&tm.tm_min, &tm.tm_sec, &csec);
/* Next look for the Format 2 type sequencing */
if (num_items_scanned != 8) {
num_items_scanned = sscanf(p,
- "packet seq # = %9d at %2d-%3s-%4d %2d:%2d:%2d.%9d",
- &pktnum, &tm.tm_mday, mon,
- &tm.tm_year, &tm.tm_hour,
- &tm.tm_min, &tm.tm_sec, &csec);
+ "packet seq # = %9d at %2d-%3s-%4d %2d:%2d:%2d.%9d",
+ &pktnum, &tm.tm_mday, mon,
+ &tm.tm_year, &tm.tm_hour,
+ &tm.tm_min, &tm.tm_sec, &csec);
}
/* if unknown format then exit with error */
/* We will need to add code to handle new format */
if (num_items_scanned != 8) {
- *err = WTAP_ERR_BAD_FILE;
- *err_info = g_strdup_printf("vms: header line not valid");
+ *err = WTAP_ERR_BAD_FILE;
+ *err_info = g_strdup_printf("vms: header line not valid");
return FALSE;
}
}
- if ( (! pkt_len) && (p = strstr(line, "Length"))) {
- p += sizeof("Length ");
- while (*p && ! isdigit((guchar)*p))
- p++;
-
- if ( !*p ) {
- *err = WTAP_ERR_BAD_FILE;
- *err_info = g_strdup_printf("vms: Length field not valid");
- return FALSE;
- }
+ if ( (! pkt_len) && (p = strstr(line, "Length"))) {
+ p += sizeof("Length ");
+ while (*p && ! isdigit((guchar)*p))
+ p++;
+
+ if ( !*p ) {
+ *err = WTAP_ERR_BAD_FILE;
+ *err_info = g_strdup_printf("vms: Length field not valid");
+ return FALSE;
+ }
- pkt_len = atoi(p);
+ pkt_len = atoi(p);
break;
- }
+ }
} while (! isdumpline(line));
p = strstr(months, mon);
if (p)
- tm.tm_mon = (int) (p - months) / 3;
+ tm.tm_mon = (int) (p - months) / 3;
tm.tm_year -= 1900;
tm.tm_isdst = -1;
@@ -413,34 +413,34 @@ parse_vms_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gch
/* Convert the ASCII hex dump to binary data */
for (i = 0; i < pkt_len; i += 16) {
- if (file_gets(line, VMS_LINE_LENGTH, fh) == NULL) {
- *err = file_error(fh, err_info);
- if (*err == 0) {
- *err = WTAP_ERR_SHORT_READ;
- }
- return FALSE;
- }
+ if (file_gets(line, VMS_LINE_LENGTH, fh) == NULL) {
+ *err = file_error(fh, err_info);
+ if (*err == 0) {
+ *err = WTAP_ERR_SHORT_READ;
+ }
+ return FALSE;
+ }
line[VMS_LINE_LENGTH] = '\0';
- if (i == 0) {
+ if (i == 0) {
while (! isdumpline(line)) { /* advance to start of hex data */
- if (file_gets(line, VMS_LINE_LENGTH, fh) == NULL) {
+ if (file_gets(line, VMS_LINE_LENGTH, fh) == NULL) {
*err = file_error(fh, err_info);
if (*err == 0) {
- *err = WTAP_ERR_SHORT_READ;
+ *err = WTAP_ERR_SHORT_READ;
}
return FALSE;
}
line[VMS_LINE_LENGTH] = '\0';
}
- while (line[offset] && !isxdigit((guchar)line[offset]))
- offset++;
+ while (line[offset] && !isxdigit((guchar)line[offset]))
+ offset++;
}
if (!parse_single_hex_dump_line(line, pd, i,
offset, pkt_len - i)) {
- *err = WTAP_ERR_BAD_FILE;
+ *err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup_printf("vms: hex dump not valid");
- return FALSE;
- }
+ return FALSE;
+ }
}
/* Avoid TCPIPTRACE-W-BUFFERSFUL, TCPIPtrace could not save n packets.
* errors.
@@ -449,13 +449,13 @@ parse_vms_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gch
* Wiretap API, we should parse those lines and return "n" as
* a packet drop count. */
if (!file_gets(line, VMS_LINE_LENGTH, fh)) {
- *err = file_error(fh, err_info);
- if (*err == 0) {
- /* There is no next line, so there's no "TCPIPtrace could not
- * save n packets" line; not an error. */
- return TRUE;
- }
- return FALSE;
+ *err = file_error(fh, err_info);
+ if (*err == 0) {
+ /* There is no next line, so there's no "TCPIPtrace could not
+ * save n packets" line; not an error. */
+ return TRUE;
+ }
+ return FALSE;
}
return TRUE;
}
@@ -493,7 +493,7 @@ parse_single_hex_dump_line(char* rec, guint8 *buf, long byte_offset,
value = (int)strtoul(s + 45 + in_off, NULL, 16); /* XXX - error check? */
if (value != byte_offset) {
- return FALSE;
+ return FALSE;
}
if (remaining > 16)
@@ -504,10 +504,10 @@ parse_single_hex_dump_line(char* rec, guint8 *buf, long byte_offset,
*/
for (i = 0; i < remaining; i++) {
- lbuf[0] = rec[offsets[i] + in_off];
- lbuf[1] = rec[offsets[i] + 1 + in_off];
+ lbuf[0] = rec[offsets[i] + in_off];
+ lbuf[1] = rec[offsets[i] + 1 + in_off];
- buf[byte_offset + i] = (guint8) strtoul(lbuf, NULL, 16);
+ buf[byte_offset + i] = (guint8) strtoul(lbuf, NULL, 16);
}
return TRUE;