[cairo] [PATCH] win32: Avoid crash on win32

Brent Fulgham bfulgham at gmail.com
Tue Feb 8 13:00:04 PST 2011


The MSVCRT implementation of strcmp will generate an access violation
if either arguments is a null pointer.

I propose the following change to test/cairo-test.c to allow tests to
complete under Windows:

*** cairo-1.10.2/test/cairo-test.c	2010-07-12 01:57:03.000000000 -0700
--- cairo-1.10.2.new/test/cairo-test.c	2011-02-08 12:50:34.017968500 -0800
***************
*** 2014,2019 ****
--- 2039,2047 ----

      for (i = 0; i < ctx->num_targets; i++) {
          const cairo_boilerplate_target_t *t = ctx->targets_to_test[i];
+         if (!t->name)
+             continue;
+
          if (strcmp (t->name, target) == 0) {
              /* XXX ask the target whether is it possible to run?
               * e.g. the xlib backend could check whether it is able to connect


More information about the cairo mailing list