#!./perl
-print "1..42\n";
+print "1..44\n";
chdir('op') || chdir('t/op') || die "sysio.t: cannot look for myself: $!";
@INC = '../../lib';
print 'not ' unless (-s $outfile == 10);
print "ok 31\n";
-close(O);
-
open(I, $outfile) || die "sysio.t: cannot read $outfile: $!";
$b = 'xyz';
chdir('..');
+# [perl #67912] syswrite prints garbage if called with empty scalar and non-zero offset
+eval { my $buf = ''; syswrite(O, $buf, 1, 0) };
+print 'not ' unless ($@ =~ /^Offset outside string /);
+print "ok 43\n";
+
+eval { my $buf = 'x'; syswrite(O, $buf, 1, 1) };
+print 'not ' unless ($@ =~ /^Offset outside string /);
+print "ok 44\n";
+
+close(O);
+
1;
# eof