From: ben Date: Sat, 25 Jan 2003 19:21:56 +0000 (+0000) Subject: Don't pass NULL to strcmp. Instead, if the user passes a font of NULL, X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/dcab086f6b8eac6e829f9ce12827afc3b8266861 Don't pass NULL to strcmp. Instead, if the user passes a font of NULL, only match table entries where the font is NULL. git-svn-id: svn://svn.tartarus.org/sgt/putty@2725 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/charset/macenc.c b/charset/macenc.c index 43105633..4aa02d1b 100644 --- a/charset/macenc.c +++ b/charset/macenc.c @@ -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;