 +    uint64_t qnid1 = bamptr_get_qnameid(bamp1);
 +    uint64_t qnid2 = bamptr_get_qnameid(bamp2);
 +    if (qnid1 != qnid2) {
-+      char str1[256], str2[256];
++      char str1[128], str2[128];
 +      long len1, len2;
 +      get_qname(qnid1,str1,sizeof(str1),&len1);
 +      get_qname(qnid2,str2,sizeof(str2),&len2);

+  str[n++] = ':';
+  n += snprintf(&str[n], l_qname-n, "%lu", y);
+  *len = n;
+}
+
+static void get_qname(uint64_t qnameid, char *qname, long l_qname, long *len) {

+  str[n++] = '.';
+  n += snprintf(&str[n], l_qname-n, "%lu", spot);
+  *len = n;
+  if (n + 1/*\0*/ > l_qname) {
+    fprintf(stderr, "(E) length of string buffer %ld must be >=%d\n", l_qname, n + 1);
+    exit(-1);
+  }
+}
+
+static inline void get_qname_illumina(uint64_t qnameid, char *str, long l_qname, long *len) {
