diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-03-31 14:51:17 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-03-31 14:51:17 +0800 |
commit | 0cdb4fef03126fa4220ff00ab4a85be48c594281 (patch) | |
tree | fc6427b2529442982ea90d9ec89d94d7a0c7fb4c /e-util | |
parent | 6ba2a1416eeb61818e7de4b16b659fa92e4c84b2 (diff) | |
download | gsoc2013-evolution-0cdb4fef03126fa4220ff00ab4a85be48c594281.tar gsoc2013-evolution-0cdb4fef03126fa4220ff00ab4a85be48c594281.tar.gz gsoc2013-evolution-0cdb4fef03126fa4220ff00ab4a85be48c594281.tar.bz2 gsoc2013-evolution-0cdb4fef03126fa4220ff00ab4a85be48c594281.tar.lz gsoc2013-evolution-0cdb4fef03126fa4220ff00ab4a85be48c594281.tar.xz gsoc2013-evolution-0cdb4fef03126fa4220ff00ab4a85be48c594281.tar.zst gsoc2013-evolution-0cdb4fef03126fa4220ff00ab4a85be48c594281.zip |
Handle NULL args semi-gracefully.
2001-03-31 Jon Trowbridge <trow@ximian.com>
* gal/util/e-util.c (g_str_compare): Handle NULL args
semi-gracefully.
svn path=/trunk/; revision=9066
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-util.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c index 8f393e1b86..18975375e6 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -40,7 +40,14 @@ int g_str_compare(const void *x, const void *y) { - return strcmp(x, y); + if (x == NULL || y == NULL) { + if (x == y) + return 0; + else + return x ? -1 : 1; + } + + return strcmp(x, y); } int |