cql_sortby_to_sortkeys - fix pr_n
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 23 Nov 2011 16:05:34 +0000 (17:05 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 23 Nov 2011 16:05:34 +0000 (17:05 +0100)
It was so broken I wonder how it ever would work.

src/cql_sortkeys.c

index 2ef3740..d501bff 100644 (file)
@@ -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);
     }
 }