From 43988c87ae8e78c0fae665381d3d4895e8cbd58a Mon Sep 17 00:00:00 2001 From: theoddone33 Date: Wed, 14 Aug 2002 18:39:54 +0000 Subject: [PATCH] Make valgrind shut up when running this. --- src/osapi/osregistry-unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osapi/osregistry-unix.cpp b/src/osapi/osregistry-unix.cpp index 08832f4..168678c 100644 --- a/src/osapi/osregistry-unix.cpp +++ b/src/osapi/osregistry-unix.cpp @@ -98,11 +98,11 @@ static char *trim_string(char *str) *ptr = 0; ptr = str+strlen(str)-1; - while (*ptr && isspace(*ptr)) { + while (ptr >= str && isspace(*ptr)) { ptr--; } - if (*ptr) { + if (ptr >= str) { ptr++; *ptr = 0; } -- 2.39.2