1
0
forked from pool/util-linux
util-linux/util-linux-2.12r-misc_utils_cal_formatting.patch

27 lines
325 B
Diff

--- misc-utils/cal.c
+++ misc-utils/cal.c
@@ -702,18 +702,16 @@
}
void
-trim_trailing_spaces(s)
- char *s;
+trim_trailing_spaces(char *s)
{
char *p;
for (p = s; *p; ++p)
continue;
- while (p > s && isspace(*--p))
- continue;
- if (p > s)
- ++p;
- *p = '\0';
+
+ p--;
+ if (isspace(*p))
+ *p = '\0';
}
/*