- self->text = strcat(self->text, x);
- self->size = strlen(self->text);
- self->text[self->size+1] = '\0';
+ self->value = wcscat(self->value, x);
+ self->size = wcslen(self->value);
+ self->value[self->size+1] = L'\0';
+}
+
+void cstring_strip(cstring_t *self, int pos, int len) {
+ if(pos + len >= self->size) {
+ if(pos <= self->size) {
+ self->value[pos] = L'\0';
+ self->size = pos;
+ }
+ return;
+ }
+ wmemmove(&self->value[pos], &self->value[pos+len], self->size - pos - len+1);
+ self->size -= len;