aboutsummaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-18 22:30:18 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-18 22:35:14 +0200
commit8eb31ad2e11038a17f66c84f48befda6b3b807d2 (patch)
tree45b4722a0a4f8d669a5e9d8d31631335dd4d7203 /common.c
parentbdad7bd7c205bd8d2e1b067d89be88b68b9da34f (diff)
downloadxK-8eb31ad2e11038a17f66c84f48befda6b3b807d2.tar.gz
xK-8eb31ad2e11038a17f66c84f48befda6b3b807d2.tar.xz
xK-8eb31ad2e11038a17f66c84f48befda6b3b807d2.zip
degesch: fix /invite
Diffstat (limited to 'common.c')
-rw-r--r--common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common.c b/common.c
index 52e737a..fab0205 100644
--- a/common.c
+++ b/common.c
@@ -70,6 +70,17 @@ str_vector_find (const struct str_vector *v, const char *s)
return -1;
}
+static char *
+str_vector_steal (struct str_vector *self, size_t i)
+{
+ // TODO: str_vector_remove() is then just free(str_vector_steal())
+ hard_assert (i < self->len);
+ char *tmp = self->vector[i];
+ memmove (self->vector + i, self->vector + i + 1,
+ (self->len-- - i) * sizeof *self->vector);
+ return tmp;
+}
+
static int
strncasecmp_ascii (const char *a, const char *b, size_t n)
{