From ad39facaee4dcbd0e3f002e0a1674fce00e92c0c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Jun 2011 23:14:57 -0700 Subject: [PATCH] * minibuf.c (Fread_buffer): Don't assume strlen fits in int. --- src/ChangeLog | 1 + src/minibuf.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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] == ' ')) -- 2.39.2