Sophie

Sophie

distrib > Fedora > 16 > x86_64 > by-pkgid > b79707c950196751387278be720462c4 > files > 7

procps-3.2.8-24.20110302git.fc16.src.rpm

diff -up procps-3.2.7/top.h.p7 procps-3.2.7/top.h
--- procps-3.2.7/top.h.p7	2006-06-25 08:41:48.000000000 +0200
+++ procps-3.2.7/top.h	2008-09-01 11:29:15.000000000 +0200
@@ -149,8 +149,13 @@ do {                                    
    int _len = 1 + snprintf(_str, sizeof(_str), fmt, ## arg);   \
    if (Batch) _ptr = _str;                                   \
    else {                                                 \
-      _ptr = &Pseudo_scrn[Pseudo_row++ * Pseudo_cols];  \
-      if (memcmp(_ptr, _str, _len)) {                \
+      int _rest;                                         \
+      _ptr = &Pseudo_scrn[Pseudo_row * Pseudo_cols];    \
+      _rest = Pseudo_size-(_ptr-Pseudo_scrn);           \
+      Pseudo_row = (Pseudo_row+1) % Screen_rows;       \
+      if (_rest < _len)                                \
+         _len = _rest;                               \
+      if (memcmp(_ptr, _str, _len)) {               \
          memcpy(_ptr, _str, _len);                \
       } else {                                 \
          _ptr = "\n";                       \