]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
bindings: fix SWIG_AsCharPtrAndSize usage
authorMichael Schroeder <mls@suse.de>
Tue, 25 Aug 2015 15:09:39 +0000 (17:09 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 25 Aug 2015 15:09:39 +0000 (17:09 +0200)
The returned size seems to be always incremented for some reason.

bindings/solv.i

index f490a2d8bd321a80de9b310980e9a8bf99305996..98338bfb8b6f0a48bbce899d96c0cbaba3eb8d97 100644 (file)
@@ -37,6 +37,8 @@ typedef struct {
   }
 #else
   res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc);
+  if (buf && size)
+    size--;
 #endif
   if (!SWIG_IsOK(res)) {
 #if defined(SWIGPYTHON)