# HG changeset patch # User Richard M. Stallman # Date 863727356 0 # Node ID d7b187832881e70f88082e49880f3771a531b990 # Parent 6fd66459ec9abc48ccb12f9ff23e8f9970d699f2 (Finsert_file_contents): Use xmalloc. not malloc. Check correctly for whether no code translation is needed. diff -r 6fd66459ec9a -r d7b187832881 src/fileio.c --- a/src/fileio.c Thu May 15 18:39:33 1997 +0000 +++ b/src/fileio.c Thu May 15 20:15:56 1997 +0000 @@ -3166,9 +3166,9 @@ 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 @@ 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. */