=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/line.c,v retrieving revision 1.7 retrieving revision 1.8 diff -c -r1.7 -r1.8 *** src/usr.bin/less/line.c 2004/04/08 15:18:28 1.7 --- src/usr.bin/less/line.c 2005/08/27 17:17:54 1.8 *************** *** 895,902 **** if (n <= 0) { int old_size_linebuf = size_linebuf; - char *fm; - char *to; if (expand_linebuf()) { /* --- 895,900 ---- *************** *** 909,919 **** /* * Shift the data to the end of the new linebuf. */ - for (fm = linebuf + old_size_linebuf, - to = linebuf + size_linebuf; - fm >= linebuf; fm--, to--) - *to = *fm; n = size_linebuf - old_size_linebuf; } linebuf[--n] = c; } --- 907,914 ---- /* * Shift the data to the end of the new linebuf. */ n = size_linebuf - old_size_linebuf; + memmove(linebuf + n, linebuf, old_size_linebuf); } linebuf[--n] = c; }