]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Don't pass NULL to strcmp. Instead, if the user passes a font of NULL,
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 25 Jan 2003 19:21:56 +0000 (19:21 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 25 Jan 2003 19:21:56 +0000 (19:21 +0000)
only match table entries where the font is NULL.

[originally from svn r2725]

charset/macenc.c

index 431056331ae0f1f8260b45d7587e3b4c9cac84e8..4aa02d1b7e009dd2b85600d84b708a9eec6582e6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: macenc.c,v 1.1 2003/01/01 19:51:12 ben Exp $ */
+/* $Id: macenc.c,v 1.2 2003/01/25 19:21:56 ben Exp $ */
 /*
  * Copyright (c) 2003 Ben Harris
  * All rights reserved.
@@ -162,7 +162,7 @@ int charset_from_macenc(int script, int region, int sysvers,
            (macencs[i].region < 0 || macencs[i].region == region) &&
            (macencs[i].sysvermin <= sysvers) &&
            (macencs[i].fontname == NULL ||
-            strcmp(macencs[i].fontname, fontname) == 0))
+            (fontname != NULL && strcmp(macencs[i].fontname, fontname) == 0)))
            return macencs[i].charset;
 
     return CS_NONE;