Whitespace changes.
authorMichael Tüxen <tuexen@fh-muenster.de>
Tue, 21 Feb 2012 15:38:30 +0000 (15:38 -0000)
committerMichael Tüxen <tuexen@fh-muenster.de>
Tue, 21 Feb 2012 15:38:30 +0000 (15:38 -0000)
svn path=/trunk/; revision=41113

pcapio.c

index 021b0f4a434e5099433d574a0916a8da91da2bbd..acd72e84298499a4fbde5443cd295a477739258a 100644 (file)
--- a/pcapio.c
+++ b/pcapio.c
@@ -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;