summaryrefslogtreecommitdiff
path: root/src/sbuf.c
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2013-11-17 18:33:14 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2013-11-17 18:33:14 +0100
commit797796e2d9d4c708668ed05359695c53f8448386 (patch)
treed97c7fbe4742c62ed8e92a710a8cc4b916304d3f /src/sbuf.c
parent5304bcb44ff71ddfa02af3bff4d05812b4fc4be3 (diff)
downloadratpoison-797796e2d9d4c708668ed05359695c53f8448386.zip
Introduce sbuf_chop()
Diffstat (limited to 'src/sbuf.c')
-rw-r--r--src/sbuf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sbuf.c b/src/sbuf.c
index 8e4556d..055006d 100644
--- a/src/sbuf.c
+++ b/src/sbuf.c
@@ -143,3 +143,12 @@ sbuf_printf_concat (struct sbuf *b, char *fmt, ...)
return b->data;
}
+
+void
+sbuf_chop (struct sbuf *b)
+{
+ if (b->len)
+ {
+ b->data[--(b->len)] = '\0';
+ }
+}