From fe98fde338ed0bed0bc652553ea998461d7d6399 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 18 Mar 1999 09:25:58 +0000 Subject: [PATCH] Avoid isspace('\0'). --- sysdeps/linux/sysinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c index 7112bd3e..49f374c4 100644 --- a/sysdeps/linux/sysinfo.c +++ b/sysdeps/linux/sysinfo.c @@ -64,11 +64,13 @@ init_sysinfo (glibtop *server) p = strchr (buffer, ':'); if (!p) continue; - + + /* Remove leading spaces from `p'. */ *p = '\0'; start = p; p++; while (isspace (*p)) p++; - while ((start > buffer) && isspace (*start)) + /* Remove trailing spaces from `buffer'. */ + while ((start > buffer) && (*start) && isspace (*start)) *start-- = '\0'; key = g_strdup (buffer);