aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2003-05-21 16:48:25 +0000
committerMax Horn2003-05-21 16:48:25 +0000
commit72d6179c470fc99a05942110fe5338f7b42181dc (patch)
treefe07fcbc66a0f70bf36bcc15dca848afc6c9b8e5 /common
parent8a82e59065433e679958feb864208db0bba0f354 (diff)
downloadscummvm-rg350-72d6179c470fc99a05942110fe5338f7b42181dc.tar.gz
scummvm-rg350-72d6179c470fc99a05942110fe5338f7b42181dc.tar.bz2
scummvm-rg350-72d6179c470fc99a05942110fe5338f7b42181dc.zip
fixed ltrim/rtrim
svn-id: r7788
Diffstat (limited to 'common')
-rw-r--r--common/config-file.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/common/config-file.cpp b/common/config-file.cpp
index ac349f6fb5..58c37ff125 100644
--- a/common/config-file.cpp
+++ b/common/config-file.cpp
@@ -30,20 +30,15 @@
#define MAXLINELEN 256
static char *ltrim(char *t) {
- for (; *t && (*t == ' '); t++);
+ while (*t == ' ')
+ t++;
return t;
}
static char *rtrim(char *t) {
- int l;
-
- for (l = strlen(t) - 1; l; l--) {
- if (t[l] == ' ') {
- *t = 0;
- } else {
- return t;
- }
- }
+ int l = strlen(t) - 1;
+ while (l >= 0 && t[l] == ' ')
+ t[l--] = 0;
return t;
}