]> code.delx.au - gnu-emacs/commitdiff
* xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Jun 2011 20:43:08 +0000 (13:43 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Jun 2011 20:43:08 +0000 (13:43 -0700)
src/ChangeLog
src/xterm.c

index f0752ff8e0c9f750bfc6e376641d61e72ac6dda8..41b2fe9aab0f938e59c5c13d74260b59a48201d9 100644 (file)
@@ -1,5 +1,7 @@
 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
+
        * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
        (x_session_initialize): Do not assume string length fits in int.
 
index f40d260dabe134b6c4890ad48af14c747c127f31..c1134521c7134412cc0a4515f829360e4380bee1 100644 (file)
@@ -8084,7 +8084,7 @@ xim_initialize (struct x_display_info *dpyinfo, char *resource_name)
     {
 #ifdef HAVE_X11R6_XIM
       struct xim_inst_t *xim_inst;
-      int len;
+      ptrdiff_t len;
 
       xim_inst = (struct xim_inst_t *) xmalloc (sizeof (struct xim_inst_t));
       dpyinfo->xim_callback_data = xim_inst;
@@ -9720,8 +9720,8 @@ same_x_server (const char *name1, const char *name2)
 {
   int seen_colon = 0;
   const char *system_name = SSDATA (Vsystem_name);
-  int system_name_length = strlen (system_name);
-  int length_until_period = 0;
+  ptrdiff_t system_name_length = SBYTES (Vsystem_name);
+  ptrdiff_t length_until_period = 0;
 
   while (system_name[length_until_period] != 0
         && system_name[length_until_period] != '.')