From: Richard M. Stallman Date: Thu, 15 May 1997 20:15:56 +0000 (+0000) Subject: (Finsert_file_contents): Use xmalloc. not malloc. X-Git-Tag: emacs-20.1~2125 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b00ca0d7ea02ff7e667dfad21d8adca1218d11f6;p=emacs.git (Finsert_file_contents): Use xmalloc. not malloc. Check correctly for whether no code translation is needed. --- diff --git a/src/fileio.c b/src/fileio.c index f6541062f99..e81893c185a 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3166,9 +3166,9 @@ This does code conversion according to the value of\n\ if (!NILP (replace) && (! CODING_REQUIRE_CONVERSION (&coding) || (coding.type == coding_type_automatic - && ! CODING_REQUIRE_TEXT_CONVERSION (&coding)) + && ! CODING_REQUIRE_EOL_CONVERSION (&coding)) || (coding.eol_type == CODING_EOL_AUTOMATIC - && ! CODING_REQUIRE_EOL_CONVERSION (&coding)))) + && ! CODING_REQUIRE_TEXT_CONVERSION (&coding)))) { int same_at_start = BEGV; int same_at_end = ZV; @@ -3336,7 +3336,7 @@ This does code conversion according to the value of\n\ int bufpos; /* Make sure that the gap is large enough. */ int bufsize = 2 * st.st_size; - unsigned char *conversion_buffer = (unsigned char *) malloc (bufsize); + unsigned char *conversion_buffer = (unsigned char *) xmalloc (bufsize); /* First read the whole file, performing code conversion into CONVERSION_BUFFER. */