develooper Front page | perl.perl5.porters | Postings from March 2013

Re: [perl #117265] [PATCH] e213661 no warnings 'safesyscalls', fatalnul checks

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
March 23, 2013 16:42
Subject:
Re: [perl #117265] [PATCH] e213661 no warnings 'safesyscalls', fatalnul checks
Message ID:
20130323164207.GL2413@iabyn.com
On Sat, Mar 23, 2013 at 09:49:12AM -0500, Reini Urban wrote:
> No, it actually follows the old behavior: silently ignore and go on.

Ah I was confused by this:

+#define CHECK_SAFESYSCALLS(what,pv)                                     \
+    if (SvPOK(pv)) {                                                    \
+        char *i;                                                        \
+        char *p = SvPVX(pv);                                            \
+        if ( (i = strchr(p, 0))&&(i-p)&&((size_t)(i-p)<SvCUR(pv)-1) ) { \
+            SETERRNO(EINVAL, LIB_INVARG);                               \
+            if (ckWARN(WARN_SAFESYSCALLS))                              \
+                Perl_croak(aTHX_ "Invalid \\0 character in %s: %s\\0%s",\
+                           what,p,++i);                                 \

where you SETERRNO even when not warning. What purpose does that serve?

-- 
You're only as old as you look.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About