aboutsummaryrefslogtreecommitdiff
path: root/op/vos_String.c
diff options
context:
space:
mode:
Diffstat (limited to 'op/vos_String.c')
-rw-r--r--op/vos_String.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/op/vos_String.c b/op/vos_String.c
index 679e243..ca13453 100644
--- a/op/vos_String.c
+++ b/op/vos_String.c
@@ -64,7 +64,6 @@ int str_append_c(struct String *str, const int c)
*/
int str_append(struct String *S, const char *str)
{
- int i;
int len;
if (! S)
@@ -79,10 +78,11 @@ int str_append(struct String *S, const char *str)
if (! S->buf)
return E_MEM;
}
- for (i = 0; i < len; i++)
- S->buf[S->idx++] = str[i];
- S->buf[S->idx] = '\0';
+ memcpy(&S->buf[S->idx], str, len);
+
+ S->idx += len;
+ S->buf[S->idx] = '\0';
return 0;
}