From: Paul Eggert Date: Mon, 20 Jun 2011 06:14:57 +0000 (-0700) Subject: * minibuf.c (Fread_buffer): Don't assume strlen fits in int. X-Git-Tag: emacs-pretest-24.0.90~104^2~473^2~19 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ad39facaee4dcbd0e3f002e0a1674fce00e92c0c;p=emacs.git * minibuf.c (Fread_buffer): Don't assume strlen fits in int. --- diff --git a/src/ChangeLog b/src/ChangeLog index 8bff8e53fbd..238e37a43a1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,6 @@ 2011-06-20 Paul Eggert + * minibuf.c (Fread_buffer): * lread.c (intern, intern_c_string): * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]: Don't assume string length fits in int. diff --git a/src/minibuf.c b/src/minibuf.c index 1b555035cfe..ca2f22df9ed 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -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] == ' '))