]> granicus.if.org Git - mutt/commitdiff
wctomb(0,wc) is needed to work for bounds checking.
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 25 May 2000 08:45:47 +0000 (08:45 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 25 May 2000 08:45:47 +0000 (08:45 +0000)
mbyte.c

diff --git a/mbyte.c b/mbyte.c
index ee6eab56dd55b13e079feab74480acff964111b3..d2eff2012c98121c6e087d94c410a7412b2de286 100644 (file)
--- a/mbyte.c
+++ b/mbyte.c
@@ -22,13 +22,11 @@ void mutt_set_charset (char *charset)
 
 int wctomb (char *s, wchar_t wc)
 {
-  if (!s)
-    return 0;
   if (Charset_is_utf8)
     return mutt_wctoutf8 (s, wc);
   else if (wc < 0x100)
   {
-    *s = wc;
+    if (s) *s = wc;
     return 1;
   }
   else