CCL: use strxcat rather than strlen+memcpy
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 20 Sep 2011 10:23:24 +0000 (12:23 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 20 Sep 2011 10:23:24 +0000 (12:23 +0200)
src/cclfind.c

index 7932ecb..a80f154 100644 (file)
@@ -385,10 +385,8 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
 
             if (p->u.t.term[0] && cclp->look_token->ws_prefix_len)
             {
-                size_t len = strlen(p->u.t.term);
-                memcpy(p->u.t.term + len, cclp->look_token->ws_prefix_buf,
-                       cclp->look_token->ws_prefix_len);
-                p->u.t.term[len + cclp->look_token->ws_prefix_len] = '\0';
+                strxcat(p->u.term, cclp->look_token->ws_prefix_buf,
+                        cclp->look_token->ws_prefix_len);
             }
             for (j = 0; j < src_len; j++)
             {