* minibuf.c (Fread_buffer): Don't assume strlen fits in int.
[bpt/emacs.git] / src / minibuf.c
index 1b55503..ca2f22d 100644 (file)
@@ -1115,7 +1115,7 @@ function, instead of the usual behavior.  */)
 {
   Lisp_Object args[4], result;
   char *s;
-  int len;
+  ptrdiff_t len;
   int count = SPECPDL_INDEX ();
 
   if (BUFFERP (def))
@@ -1137,7 +1137,7 @@ function, instead of the usual behavior.  */)
          if (STRINGP (prompt))
            {
              s = SSDATA (prompt);
-             len = strlen (s);
+             len = SBYTES (prompt);
              if (len >= 2 && s[len - 2] == ':' && s[len - 1] == ' ')
                len = len - 2;
              else if (len >= 1 && (s[len - 1] == ':' || s[len - 1] == ' '))