char *tmpbuf;
HV *stash;
GV *tmpgv;
+ U32 tmplen = namelen + 2;
PERL_ARGS_ASSERT_GV_STASHPVN;
- if (namelen + 2 <= sizeof smallbuf)
+ if (tmplen <= sizeof smallbuf)
tmpbuf = smallbuf;
else
- Newx(tmpbuf, namelen + 2, char);
- Copy(name,tmpbuf,namelen,char);
- tmpbuf[namelen++] = ':';
- tmpbuf[namelen++] = ':';
- tmpgv = gv_fetchpvn_flags(tmpbuf, namelen, flags, SVt_PVHV);
+ Newx(tmpbuf, tmplen, char);
+ Copy(name, tmpbuf, namelen, char);
+ tmpbuf[namelen] = ':';
+ tmpbuf[namelen+1] = ':';
+ tmpgv = gv_fetchpvn_flags(tmpbuf, tmplen, flags, SVt_PVHV);
if (tmpbuf != smallbuf)
Safefree(tmpbuf);
if (!tmpgv)