From 892d11d2bee5e897a9165061c2da7efca2f9e7c9 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 19 Aug 2018 19:43:44 +0300 Subject: [PATCH] Fixed: trimSeparators function --HG-- branch : patches-from-atys --- code/nel/include/nel/misc/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index 416b0545c..bf7276cd8 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -281,10 +281,10 @@ template T trimSeparators (const T &str) { typename T::size_type start = 0; typename T::size_type size = str.size(); - while (start < size && str[start] == ' ' && str[start] == '\t') + while (start < size && (str[start] == ' ' || str[start] == '\t')) start++; typename T::size_type end = size; - while (end > start && str[end-1] == ' ' && str[end-1] == '\t') + while (end > start && (str[end-1] == ' ' || str[end-1] == '\t')) end--; return str.substr (start, end-start); }