diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-01-14 21:42:52 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-01-14 21:42:52 +0100 |
commit | a8cde98ad6b747142ea1798f00a6b8c11b208709 (patch) | |
tree | aef751234844b8ba09baee07035e00ab962127a5 | |
parent | f7aa4a3269a21f4d0c83f11a0aef4ccf821ce6e2 (diff) | |
download | blogc-a8cde98ad6b747142ea1798f00a6b8c11b208709.tar.gz blogc-a8cde98ad6b747142ea1798f00a6b8c11b208709.tar.bz2 blogc-a8cde98ad6b747142ea1798f00a6b8c11b208709.zip |
utils: string: strip form-feed and vertical-tab chars as whitespaces
-rw-r--r-- | src/utils/strings.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils/strings.c b/src/utils/strings.c index 846ae95..3151612 100644 --- a/src/utils/strings.c +++ b/src/utils/strings.c @@ -111,7 +111,8 @@ b_str_lstrip(char *str) size_t str_len = strlen(str); for (i = 0; i < str_len; i++) { if ((str[i] != ' ') && (str[i] != '\t') && (str[i] != '\n') && - (str[i] != '\r') && (str[i] != '\t')) + (str[i] != '\r') && (str[i] != '\t') && (str[i] != '\f') && + (str[i] != '\v')) { str += i; break; @@ -134,7 +135,8 @@ b_str_rstrip(char *str) size_t str_len = strlen(str); for (i = str_len - 1; i >= 0; i--) { if ((str[i] != ' ') && (str[i] != '\t') && (str[i] != '\n') && - (str[i] != '\r') && (str[i] != '\t')) + (str[i] != '\r') && (str[i] != '\t') && (str[i] != '\f') && + (str[i] != '\v')) { str[i + 1] = '\0'; break; |