=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/display.c,v retrieving revision 1.21 retrieving revision 1.22 diff -c -r1.21 -r1.22 *** src/usr.bin/top/display.c 2005/06/17 12:12:28 1.21 --- src/usr.bin/top/display.c 2005/07/01 19:33:35 1.22 *************** *** 1,4 **** ! /* $OpenBSD: display.c,v 1.21 2005/06/17 12:12:28 markus Exp $ */ /* * Top users/processes display for Unix --- 1,4 ---- ! /* $OpenBSD: display.c,v 1.22 2005/07/01 19:33:35 jaredy Exp $ */ /* * Top users/processes display for Unix *************** *** 138,144 **** display_width = MAX_COLS - 1; /* now, allocate space for the screen buffer */ ! screenbuf = malloc(display_lines * display_width); if (screenbuf == NULL) return (-1); --- 138,144 ---- display_width = MAX_COLS - 1; /* now, allocate space for the screen buffer */ ! screenbuf = malloc(display_lines * display_width + 1); if (screenbuf == NULL) return (-1); *************** *** 675,680 **** --- 675,681 ---- /* truncate the line to conform to our current screen width */ linebuf[display_width] = '\0'; + bufferline[display_width] = '\0'; /* is line higher than we went on the last display? */ if (linenum >= last_hi) {