diff src/unicode.c @ 3452:551c008d3777

[xemacs-hg @ 2006-06-14 06:10:08 by aidan] Fix snprintf problems with the Win32 build.
author aidan
date Wed, 14 Jun 2006 06:10:10 +0000
parents d1754e7f0cea
children 98af8a976fc3
line wrap: on
line diff
--- a/src/unicode.c	Tue Jun 13 21:50:52 2006 +0000
+++ b/src/unicode.c	Wed Jun 14 06:10:10 2006 +0000
@@ -1112,7 +1112,7 @@
       if (NILP (Vcurrent_jit_charset) || 
 	  (-1 == (i = get_free_codepoint(Vcurrent_jit_charset))))
 	{
-	  Ascbyte setname[32]; 
+	  Ibyte setname[32]; 
 	  Lisp_Object charset_descr = build_string
 	    ("Mule charset for otherwise unknown Unicode code points.");
 	  Lisp_Object charset_regr = build_string("iso10646-1");
@@ -1125,8 +1125,12 @@
 	      last_jit_charset_final = 0x30;
 	    }
 
-	  snprintf(setname, sizeof(setname), 
-		   "jit-ucs-charset-%d", number_of_jit_charsets++);
+	  /* Assertion added partly because our Win32 layer doesn't
+	     support snprintf; with this, we're sure it won't overflow
+	     the buffer.  */
+	  assert(100 > number_of_jit_charsets);
+
+	  qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets++);
 
 	  /* Aside: GCPROing here would be overkill according to the FSF's
 	     philosophy. make-charset cannot currently GC, but is intended
@@ -1136,7 +1140,7 @@
 
 	  GCPRO2 (charset_descr, charset_regr);
 	  Vcurrent_jit_charset = Fmake_charset 
-	    (intern(setname), charset_descr, 
+	    (intern((const CIbyte *)setname), charset_descr, 
 	     /* Set encode-as-utf-8 to t, to have this character set written
 		using UTF-8 escapes in escape-quoted and ctext. This
 		sidesteps the fact that our internal character -> Unicode