r21508 - gnucash/trunk/src/gnome - Protect strcmp from crashing on NULL values

Derek Atkins warlord at MIT.EDU
Mon Oct 31 10:40:12 EDT 2011


Geert Janssens <gjanssens at code.gnucash.org> writes:

> -    if(strcmp(order, DEFAULT_SORT_ORDER) != 0)
> +    if (order && (strcmp (order, DEFAULT_SORT_ORDER) != 0))

Why not use safe_strcmp()?

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list