IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15226


Ignore:
Timestamp:
Oct 4, 2007, 4:40:02 PM (19 years ago)
Author:
Paul Price
Message:

Handle NULL strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadataItemCompare.c

    r11686 r15226  
    7171            return false;
    7272        }
    73         psTrace("psLib.types", 10, "Comparing '%s' with '%s'\n",
    74                 compare->data.str, template->
    75                 data.str);
    76         return (strcasecmp(compare->data.V, template->
    77                            data.V) == 0) ? true : false;
     73        psTrace("psLib.types", 10, "Comparing '%s' with '%s'\n", compare->data.str, template->data.str);
     74        if ((!compare->data.V && template->data.V) || (!template->data.V && compare->data.V)) {
     75            return false;
     76        }
     77        return (strcasecmp(compare->data.V, template->data.V) == 0) ? true : false;
    7878    default:
    7979        // Simply don't know how to compare more complex types.
Note: See TracChangeset for help on using the changeset viewer.