Commit 8abc3f12 authored by Paul Eggert's avatar Paul Eggert

* coding.c (encode_coding_raw_text): Avoid unnecessary test

the first time through the loop, since we know p0 < p1 then.
This also avoids a gcc -Wstrict-overflow warning.
parent a2d26660
2011-03-22 Paul Eggert <eggert@cs.ucla.edu>
* coding.c (encode_coding_raw_text): Avoid unnecessary test
the first time through the loop, since we know p0 < p1 then.
This also avoids a gcc -Wstrict-overflow warning.
* lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
leading to a memory leak, possible in functions like
load_charset_map_from_file that can allocate an unbounded number
......@@ -5266,11 +5266,12 @@ encode_coding_raw_text (struct coding_system *coding)
unsigned char str[MAX_MULTIBYTE_LENGTH], *p0 = str, *p1 = str;
CHAR_STRING_ADVANCE (c, p1);
while (p0 < p1)
do
{
EMIT_ONE_BYTE (*p0);
p0++;
}
while (p0 < p1);
}
}
else
......
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