From: Adam Dickmeiss Date: Wed, 23 Nov 2011 16:05:34 +0000 (+0100) Subject: cql_sortby_to_sortkeys - fix pr_n X-Git-Tag: v4.2.21~1 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=5650509910a3a243d42113305be7ef5412d2f95e;p=yaz-moved-to-github.git cql_sortby_to_sortkeys - fix pr_n It was so broken I wonder how it ever would work. --- diff --git a/src/cql_sortkeys.c b/src/cql_sortkeys.c index 2ef3740..d501bff 100644 --- a/src/cql_sortkeys.c +++ b/src/cql_sortkeys.c @@ -33,10 +33,11 @@ static void pr_n(void (*pr)(const char *buf, void *client_data), } else { - strcpy(tmp, buf); + memcpy(tmp, buf, left); + tmp[left] = '\0'; left = 0; } - pr(client_data, tmp); + pr(tmp, client_data); } }