From 5650509910a3a243d42113305be7ef5412d2f95e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 23 Nov 2011 17:05:34 +0100 Subject: [PATCH] cql_sortby_to_sortkeys - fix pr_n It was so broken I wonder how it ever would work. --- src/cql_sortkeys.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } } -- 1.7.10.4