Coverity: CHAR_IO: CID 595
authorNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 13 Jan 2012 05:48:40 +0000 (00:48 -0500)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 13 Jan 2012 05:48:40 +0000 (00:48 -0500)
* 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 <nelson.ferreira@ieee.org>
lib-src/make-docfile.c

index 5ddd801..a45e496 100644 (file)
@@ -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