Commit 1ebfdcb6 authored by Paul Eggert's avatar Paul Eggert
Browse files

* xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.

parent 0a2f5c1a
2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
* xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
Fix more problems found by GCC 4.6.0's static checks.
* xdisp.c (vmessage): Use a better test for character truncation.
......
......@@ -8417,10 +8417,13 @@ vmessage (const char *m, va_list ap)
/* Do any truncation at a character boundary. */
if (! (0 <= len && len < bufsize))
for (len = strnlen (buf, bufsize);
len && ! CHAR_HEAD_P (buf[len - 1]);
len--)
continue;
{
char *end = memchr (buf, 0, bufsize);
for (len = end ? end - buf : bufsize;
len && ! CHAR_HEAD_P (buf[len - 1]);
len--)
continue;
}
message2 (FRAME_MESSAGE_BUF (f), len, 0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment