aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Str.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Str.c b/Str.c
index e5a0982..eff82a4 100644
--- a/Str.c
+++ b/Str.c
@@ -278,8 +278,8 @@ void
Strchop(Str s)
{
STR_LENGTH_CHECK(s);
- while ((s->ptr[s->length - 1] == '\n' || s->ptr[s->length - 1] == '\r') &&
- s->length > 0) {
+ while (s->length > 0 &&
+ (s->ptr[s->length - 1] == '\n' || s->ptr[s->length - 1] == '\r')) {
s->length--;
}
s->ptr[s->length] = '\0';