summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sv.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index 93188dff27..ed7ebdcbe1 100644
--- a/sv.c
+++ b/sv.c
@@ -3530,16 +3530,17 @@ void
Perl_sv_setpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN len)
{
register char *dptr;
- {
- /* len is STRLEN which is unsigned, need to copy to signed */
- IV iv = len;
- assert(iv >= 0);
- }
+
SV_CHECK_THINKFIRST(sv);
if (!ptr) {
(void)SvOK_off(sv);
return;
}
+ else {
+ /* len is STRLEN which is unsigned, need to copy to signed */
+ IV iv = len;
+ assert(iv >= 0);
+ }
(void)SvUPGRADE(sv, SVt_PV);
SvGROW(sv, len + 1);