diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2012-02-21 15:38:30 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2012-02-21 15:38:30 +0000 |
commit | 3806dfa6c8e632e4360f6d1891b88ecece017809 (patch) | |
tree | 0939499afe9afd0eb937c77c2783a5cfd8821d6d /pcapio.c | |
parent | 822782f7c4bcd95c5a715f5e947e8ba19e6a563c (diff) |
Whitespace changes.
svn path=/trunk/; revision=41113
Diffstat (limited to 'pcapio.c')
-rw-r--r-- | pcapio.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -289,28 +289,28 @@ libpcap_write_session_header_block(FILE *fp, /* Size of base header */ block_total_length = sizeof(struct shb) + sizeof(guint32); - if ((comment)&&(strlen(comment) > 0) && (strlen(comment) < G_MAXUINT16)) { + if ((comment != NULL) && (strlen(comment) > 0) && (strlen(comment) < G_MAXUINT16)) { block_total_length += sizeof(struct option) + (guint16)(ADD_PADDING(strlen(comment) + 1)); have_options = TRUE; } - if ((hw)&&(strlen(hw) > 0) && (strlen(hw) < G_MAXUINT16)) { + if ((hw != NULL) && (strlen(hw) > 0) && (strlen(hw) < G_MAXUINT16)) { block_total_length += sizeof(struct option) + (guint16)(ADD_PADDING(strlen(hw) + 1)); have_options = TRUE; } - if ((os)&&(strlen(os) > 0) && (strlen(os) < G_MAXUINT16)) { + if ((os != NULL) && (strlen(os) > 0) && (strlen(os) < G_MAXUINT16)) { block_total_length += sizeof(struct option) + (guint16)(ADD_PADDING(strlen(os) + 1)); have_options = TRUE; } - if ((appname)&&(strlen(appname) > 0) && (strlen(appname) < G_MAXUINT16)) { + if ((appname != NULL) && (strlen(appname) > 0) && (strlen(appname) < G_MAXUINT16)) { block_total_length += sizeof(struct option) + (guint16)(ADD_PADDING(strlen(appname) + 1)); have_options = TRUE; } /* If we have options add size of end-of-options */ - if(have_options){ + if (have_options) { block_total_length += sizeof(struct option); } /* write shb header */ @@ -322,7 +322,7 @@ libpcap_write_session_header_block(FILE *fp, shb.section_length = section_length; WRITE_DATA(fp, &shb, sizeof(struct shb), *bytes_written, err); - if ((comment)&&(strlen(comment) > 0) && (strlen(comment) < G_MAXUINT16)) { + if ((comment != NULL) && (strlen(comment) > 0) && (strlen(comment) < G_MAXUINT16)) { /* write opt_comment options */ option.type = OPT_COMMENT; option.value_length = (guint16)(strlen(comment) + 1); @@ -332,7 +332,7 @@ libpcap_write_session_header_block(FILE *fp, WRITE_DATA(fp, &padding, 4 - (strlen(hw) + 1) % 4, *bytes_written, err); } } - if ((hw)&&(strlen(hw) > 0) && (strlen(hw) < G_MAXUINT16)) { + if ((hw != NULL) && (strlen(hw) > 0) && (strlen(hw) < G_MAXUINT16)) { /* write shb_hardware options */ option.type = SHB_HARDWARE; option.value_length = (guint16)(strlen(hw) + 1); @@ -342,7 +342,7 @@ libpcap_write_session_header_block(FILE *fp, WRITE_DATA(fp, &padding, 4 - (strlen(hw) + 1) % 4, *bytes_written, err); } } - if ((os)&&(strlen(os) > 0) && (strlen(os) < G_MAXUINT16)) { + if ((os != NULL) && (strlen(os) > 0) && (strlen(os) < G_MAXUINT16)) { /* write shb_os options */ option.type = SHB_OS; option.value_length = (guint16)(strlen(os) + 1); @@ -352,7 +352,7 @@ libpcap_write_session_header_block(FILE *fp, WRITE_DATA(fp, &padding, 4 - (strlen(os) + 1) % 4, *bytes_written, err); } } - if ((appname)&&(strlen(appname) > 0) && (strlen(appname) < G_MAXUINT16)) { + if ((appname != NULL) && (strlen(appname) > 0) && (strlen(appname) < G_MAXUINT16)) { /* write shb_userappl options */ option.type = SHB_USERAPPL; option.value_length = (guint16)(strlen(appname) + 1); @@ -362,7 +362,7 @@ libpcap_write_session_header_block(FILE *fp, WRITE_DATA(fp, &padding, 4 - (strlen(appname) + 1) % 4, *bytes_written, err); } } - if(have_options){ + if (have_options) { /* write end of options */ option.type = OPT_ENDOFOPT; option.value_length = 0; |