strbuf.c: make 'strbuf_rtrim' alittle more readable
This commit is contained in:
parent
c558135c63
commit
925972faa5
1 changed files with 2 additions and 1 deletions
|
|
@ -130,7 +130,8 @@ void strbuf_trim(strbuf_t *s) {
|
||||||
|
|
||||||
void strbuf_rtrim(strbuf_t *s) {
|
void strbuf_rtrim(strbuf_t *s) {
|
||||||
|
|
||||||
for(; s->len && isspace(s->buf[s->len-1]); s->len--);
|
while(s->len && isspace(s->buf[s->len-1]))
|
||||||
|
s->len--;
|
||||||
s->buf[s->len] = '\0';
|
s->buf[s->len] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue