summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a2d871)
raw | patch | inline | side by side (parent: 5a2d871)
author | Fredrik Soderblom <fredrik@xpd.se> | |
Thu, 1 Oct 2009 12:24:46 +0000 (14:24 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Thu, 1 Oct 2009 12:24:46 +0000 (14:24 +0200) |
In the previous code the null byte was included in the Perl string,
making the string handling awkward.
making the string handling awkward.
bindings/perl/Oping.xs | patch | blob | history |
diff --git a/bindings/perl/Oping.xs b/bindings/perl/Oping.xs
index 6106e13760cae899222033299c08e0f88ab35b8d..5731d3d8088f28d4df8eb826dba4ab232b1b1b98 100644 (file)
--- a/bindings/perl/Oping.xs
+++ b/bindings/perl/Oping.xs
free (buffer);
break;
}
+ buffer[buffer_size - 1] = 0;
- XPUSHs (sv_2mortal (newSVpvn(buffer,buffer_size)));
+ XPUSHs (sv_2mortal (newSVpvn(buffer, strlen (buffer))));
free(buffer);
} while (0);