From: erg Date: Thu, 17 Feb 2005 15:36:01 +0000 (+0000) Subject: Fix bug on sgis and suns: bsearch requires a non-NULL array pointer. X-Git-Tag: LAST_LIBGRAPH~32^2~7927 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d1af7271b7ccdd1017f3fc70f9d8c436a612af5;p=graphviz Fix bug on sgis and suns: bsearch requires a non-NULL array pointer. --- diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index cbc95d025..8d8a3b1f5 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -246,7 +246,7 @@ static void gvrender_resolve_color(gvrender_features_t * features, color->u.string = name; color->type = COLOR_STRING; tok = canontoken(name); - if ((bsearch(&tok, features->knowncolors, features->sz_knowncolors, + if (!features->knowncolors || (bsearch(&tok, features->knowncolors, features->sz_knowncolors, sizeof(char *), gvrender_comparestr)) == NULL) { /* if tok was not found in known_colors */ colorxlate(name, color, features->color_type);