fix corrupted fields string

This commit is contained in:
albert 2002-12-08 04:12:33 +00:00
parent 2df855bc46
commit 732a595fa1
2 changed files with 6 additions and 5 deletions

6
NEWS
View File

@ -1,12 +1,12 @@
procps-3.1.1 --> procps-3.1.2
better RPM generation
general C99 clean-up
use C99 features
some seLinux fixes
now count Inact_laundry as needed #172163
ps: fewer globals
ps: hardware-enforced buffer protection
ps: smaller (was it 1 kB or 2 kB ?)
ps: 1 kB smaller
top: B command added (for bold on/off)
top: handle old (and future) config files
top: man page tweak
@ -26,7 +26,7 @@ vmstat faster on 2.5.xx kernels
vmstat header fixed
vmstat -a re-fixed
procps-3.1.0 --> procps-3.1.0
procps-3.0.5 --> procps-3.1.0
vmstat displays IO-wait time instead of bogus "w"
can build w/o shared library (set SHARED=0)

5
top.c
View File

@ -1272,8 +1272,9 @@ static int rc_read_old (const char *const buf, RCF_t *rc) {
if (scoreboard[c|0xe0u]) badchar++; // duplicates not allowed
scoreboard[c|0xe0u]++;
tmp = strchr(old,c);
if (tmp) c = *((tmp-old)+std);
else c = '.';
if (!tmp) continue;
c = *((tmp-old)+std);
if (c == '.') continue;
if (scoreboard[c&0x1fu]) badchar++; // duplicates not allowed
scoreboard[c&0x1fu]++;
rc->win[0].fieldscur[u++] = c;