Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rutgers!gatech!udel!mmdf From: JM04%SWTEXAS.BITNET@ricevm1.rice.edu Newsgroups: comp.os.minix Subject: sort.c bug fix Message-ID: <50726@nigel.ee.udel.edu> Date: 14 Apr 91 21:43:21 GMT Sender: mmdf@ee.udel.edu Lines: 18 Below are the diffs for 'sort.c' packaged with version 1.5 If 'sort.c' is used to sort files larger than 20K, it may not work properly. Last_line does not reserve a space at the end of the mem_top buffer for a '\0'. It fails under the following condition: the last character in mem_top is a '\n'. In this case the string doesn't get terminated correctly since '\0' is appended past the end of the buffer. 489,490c489,490 < < for (i = MEMORY_SIZE - 1; i > 0; i--) --- > /* Must be MEMORY_SIZE -2 to make room for insertion of '\0' */ > for (i = MEMORY_SIZE - 2; i > 0; i--) Jim Miles, Southwest Texas State University Email: JM04@SWTEXAS