Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!topaz!nike!ucbcad!ucbvax!hplabs!hp-pcd!craig From: craig@hp-pcd.UUCP (craig) Newsgroups: net.sources.bugs Subject: bugs in sort Message-ID: <41300006@hpcvlo.UUCP> Date: Thu, 4-Sep-86 13:26:00 EDT Article-I.D.: hpcvlo.41300006 Posted: Thu Sep 4 13:26:00 1986 Date-Received: Sat, 6-Sep-86 22:04:43 EDT Organization: Hewlett-Packard - Corvallis, OR Lines: 21 Nf-ID: #N:hpcvlo:41300006:000:660 Nf-From: hpcvlo!craig Sep 4 09:26:00 1986 The is a bug with the SORT program posted to net.sources. Bug #1 In the routine merge(nfiles) is a line: memcpy(Heap,Heap+1,nfile*sizeof(HEAP)); this should be: memcpy((char *)Heap, (char *)(Heap+1), nfiles*sizeof(*Heap)); Or if you don't have memcpy or are worried about overlapping memory moves: { int j; for (j=0; j1) to if (n>1)