summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorSlaven Rezic <slaven@rezic.de>2003-10-19 19:54:59 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-20 19:22:38 +0000
commita0625d383a69c2c6fd20da94ef6df644cb75b45b (patch)
treed334b43d0b0c72e5dc106c1ca169f5268111cb26 /perlio.c
parent4a30c06bd54cc1d9f8821019596ec5449d182a2e (diff)
downloadperl-a0625d383a69c2c6fd20da94ef6df644cb75b45b.tar.gz
Re: [perl #24225] [5.8.1] segfault in binmode STDOUT, ':stdio'; print 1
Message-ID: <871xt9te7g.fsf@vran.herceg.de> p4raw-id: //depot/perl@21505
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/perlio.c b/perlio.c
index faa3b19369..c4a81afd7c 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2613,8 +2613,10 @@ char *
PerlIOStdio_mode(const char *mode, char *tmode)
{
char *ret = tmode;
- while (*mode) {
- *tmode++ = *mode++;
+ if (mode) {
+ while (*mode) {
+ *tmode++ = *mode++;
+ }
}
#if defined(PERLIO_USING_CRLF) || defined(__CYGWIN__)
*tmode++ = 'b';