From db7370b62be7d81f972c5d10dee84e41c14813cf Mon Sep 17 00:00:00 2001 From: Jose Rubio Date: Mon, 19 Aug 2019 18:02:25 +0200 Subject: [PATCH] Cleanup of -Wpointer-compare warnings. --- cde/lib/DtHelp/Layout.c | 5 ++--- cde/programs/dtcm/dtcm/misc.c | 5 +++-- cde/programs/dtcm/libDtCmP/props.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cde/lib/DtHelp/Layout.c b/cde/lib/DtHelp/Layout.c index 87028bb2..6090c588 100644 --- a/cde/lib/DtHelp/Layout.c +++ b/cde/lib/DtHelp/Layout.c @@ -2379,7 +2379,7 @@ ProcessTable( /* * are any alignment characters specified? */ - if (NULL != alignCharacters && '\0' != alignCharacters) + if (NULL != alignCharacters && '\0' != *alignCharacters) { int len = mblen(alignCharacters, MB_CUR_MAX); @@ -3865,8 +3865,7 @@ ProcessContainer( * check to see if the character is 'valid'. * if not, default out of JUSTIFY_CHAR */ - if (NULL != layout->info.align_char || - '\0' == layout->info.align_char) + if ( (NULL != layout->info.align_char) && ( '\0' != *layout->info.align_char)) layout->txt_justify = _DtCvJUSTIFY_LEFT; } } diff --git a/cde/programs/dtcm/dtcm/misc.c b/cde/programs/dtcm/dtcm/misc.c index 1b8b18a8..f598633b 100644 --- a/cde/programs/dtcm/dtcm/misc.c +++ b/cde/programs/dtcm/dtcm/misc.c @@ -639,10 +639,11 @@ cm_mbchar(char *str) { free(buf); buf = NULL; } - if ( string == '\0' ) { + if ( *string == '\0' ) { free(string_head); string_head = NULL; - } else { + string = NULL; + } else if (string != NULL) { num_byte = mblen(string, MB_LEN_MAX); if(num_byte > 0) { buf = (char *)malloc(num_byte+1); diff --git a/cde/programs/dtcm/libDtCmP/props.c b/cde/programs/dtcm/libDtCmP/props.c index 930a40c2..18ddbe94 100644 --- a/cde/programs/dtcm/libDtCmP/props.c +++ b/cde/programs/dtcm/libDtCmP/props.c @@ -269,7 +269,7 @@ extern char* get_char_prop(Props *p, Props_op op) { Props_entry *step = p_get_props_entry(p, op); - if (!step || !step->property_value || step->property_value == '\0') + if (!step || !step->property_value || *step->property_value == '\0') return get_char_prop_default(op); return (step->property_value); } @@ -315,7 +315,7 @@ extern int get_int_prop(Props *p, Props_op op) { Props_entry *step = p_get_props_entry(p, op); - if (!step || !step->property_value || step->property_value == '\0') + if (!step || !step->property_value || *step->property_value == '\0') return (atoi(get_char_prop_default(op))); return (atoi(step->property_value)); } -- 2.25.1