summaryrefslogtreecommitdiff
path: root/ext/PerlIO-scalar/scalar.xs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/PerlIO-scalar/scalar.xs')
-rw-r--r--ext/PerlIO-scalar/scalar.xs7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/PerlIO-scalar/scalar.xs b/ext/PerlIO-scalar/scalar.xs
index 67f674a2a5..f2481f4197 100644
--- a/ext/PerlIO-scalar/scalar.xs
+++ b/ext/PerlIO-scalar/scalar.xs
@@ -85,9 +85,12 @@ IV
PerlIOScalar_seek(pTHX_ PerlIO * f, Off_t offset, int whence)
{
PerlIOScalar *s = PerlIOSelf(f, PerlIOScalar);
- SvGETMAGIC(s->var);
- STRLEN oldcur = SvCUR(s->var);
+ STRLEN oldcur;
STRLEN newlen;
+
+ SvGETMAGIC(s->var);
+ oldcur = SvCUR(s->var);
+
switch (whence) {
case SEEK_SET:
s->posn = offset;