Avoid using PL_na with newSVpv

[email protected] (Torsten Schoenfeld)
Newsgroups perl.xs
Message-ID <[email protected]>
I recently tracked down a difficult bug that occured only when one of my
XS modules was used in conjunction with certain other XS modules (e.g.,
XML::Parser or String::Approx).  It turned out to be due to the
incorrect assumption that PL_na will always be zero.  Specifically, we used

  newSVpv (string, PL_na) // do not do this

when we didn't have the string's length.  This breaks if some other XS
module writes to PL_na (via SvPV, most likely).  So always use an
explicit zero instead:

  newSVpv (string, 0)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.