const-ness fix in savepv's passing of NULL
Nick Ing-Simmons [Tue, 15 Jan 2002 07:57:47 +0000 (07:57 +0000)]
p4raw-id: //depot/perlio@14268

util.c

diff --git a/util.c b/util.c
index 83b9026..72c85cd 100644 (file)
--- a/util.c
+++ b/util.c
@@ -891,11 +891,11 @@ Copy a string to a safe spot.  This does not use an SV.
 char *
 Perl_savepv(pTHX_ const char *sv)
 {
-    register char *newaddr = sv;
+    register char *newaddr = Nullch;
     if (sv) {
        New(902,newaddr,strlen(sv)+1,char);
        (void)strcpy(newaddr,sv);
-    } 
+    }
     return newaddr;
 }
 
@@ -932,7 +932,7 @@ This does not use an SV.
 char *
 Perl_savesharedpv(pTHX_ const char *sv)
 {
-    register char *newaddr = sv;
+    register char *newaddr = Nullch;
     if (sv) {
        newaddr = PerlMemShared_malloc(strlen(sv)+1);
        (void)strcpy(newaddr,sv);