Fix crash on w32
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 3 Nov 2015 20:45:52 +0000 (21:45 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 3 Nov 2015 20:45:52 +0000 (21:45 +0100)
src/data/make-file.c

index af1dc5742b6849f8e2c1d73c014d5ac74b30f898..b67ed307019b87133ec343ab1f7893f782f3f360 100644 (file)
@@ -153,7 +153,7 @@ static TCHAR *
 convert_to_filename_encoding (const char *s, size_t len, const char *current_encoding)
 {
   const char *enc = current_encoding;
-  if (0 == strcmp (current_encoding, "Auto"))
+  if (NULL == enc || 0 == strcmp (enc, "Auto"))
     enc = locale_charset ();
 
   return (TCHAR *) recode_string ("UTF-16LE", enc, s, len);