This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In I18N::Langinfo::langinfo(), use newSVpv(), as it will call strlen()
[perl5.git] / ext / I18N-Langinfo / Langinfo.xs
index 62f3580..d087075 100644 (file)
@@ -21,14 +21,7 @@ langinfo(code)
   PROTOTYPE: _
   CODE:
 #ifdef HAS_NL_LANGINFO
-       {
-         char *s;
-
-         if ((s = nl_langinfo(code)))
-             RETVAL = newSVpvn(s, strlen(s));
-         else
-             RETVAL = &PL_sv_undef;
-       }
+       RETVAL = newSVpv(nl_langinfo(code), 0);
 #else
        croak("nl_langinfo() not implemented on this architecture");
 #endif