ZebraRetrievalRecord changed. Fixed returning of null buffers in the wrapper
[idzebra-moved-to-github.git] / perl / IDZebra.i
index bbbdcff..f00d7ab 100644 (file)
 /* RetrievalRecordBuff is a special construct, to allow to map a char * buf
    to non-null terminated perl string scalar value (SVpv). */
 %typemap(out) RetrievalRecordBuf * {
-  $result = newSVpv($1->buf,$1->len);
+  if ($1->len) {
+    $result = newSVpv($1->buf,$1->len);
+  } else {
+    $result = newSVpv("",0);
+  }
   sv_2mortal($result);
   argvi++;
 }