From 66e90621df7d29616f7a8b0c843af51d1de48c15 Mon Sep 17 00:00:00 2001 From: Nelson Ferreira Date: Fri, 13 Jan 2012 00:48:40 -0500 Subject: [PATCH] Coverity: CHAR_IO: CID 595 * lib-src/make-docfile.c (get_dyna_doc): Make explicit the discard of non existing bits on the getc call assignment to the saved string. Signed-off-by: Nelson Ferreira --- lib-src/make-docfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 5ddd801..a45e496 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -881,7 +881,8 @@ get_dyna_doc(FILE *infile, char **saved_string) } *saved_string = xmalloc(length); for (i = 0; i < length; i++) { - (*saved_string)[i] = getc(infile); + c = getc(infile); + (*saved_string)[i] = (char)(c & 0xFF); } /* The last character is a ^_. * That is needed in the .elc file -- 2.25.1