+ if (lenb == 0 && lena > 0) return -1;
+
+ bufa = sqlite3_malloc(lena+1);
+ bufb = sqlite3_malloc(lenb+1);
+
+ strncpy(bufa, a, lena);
+ strncpy(bufb, b, lenb);
+ bufa[lena] = 0;
+ bufb[lenb] = 0;
+
+ rv = zpm_vercmp(bufa, bufb);
+ sqlite3_free(bufa);
+ sqlite3_free(bufb);
+ return rv;