From: Perl 5 Porters Date: Sat, 7 Sep 1996 03:11:03 +0000 (+0000) Subject: perl 5.003_05: perlio.c X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8c86a92082b8351484629c697bc26f3f48bf767e;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_05: perlio.c Eliminate potential "signed vs. unsigned" warning Add PerlIO_reopen and PerlIO_cgetname functions. --- diff --git a/perlio.c b/perlio.c index 9c74dd0..b9a3a22 100644 --- a/perlio.c +++ b/perlio.c @@ -272,6 +272,16 @@ const char *mode; return fdopen(fd,mode); } +#undef PerlIO_reopen +PerlIO * +PerlIO_reopen(fd,mode) +char *name; +char *mode; +PerlIO *f; +const char *mode; +{ + return freopen(name,mode,f); +} #undef PerlIO_close int @@ -289,6 +299,19 @@ PerlIO *f; return feof(f); } +#undef PerlIO_getname +char * +PerlIO_getname(f,buf) +PerlIO *f; +char *buf; +{ +#ifdef VMS + return fgetname(f,buf); +#else + croak("Don't know how to get file name"); +#endif +} + #undef PerlIO_getc int PerlIO_getc(f) @@ -584,7 +607,7 @@ va_list ap; int val = vsprintf(s, fmt, ap); if (n >= 0) { - if (strlen(s) >= n) + if (strlen(s) >= (STRLEN)n) { PerlIO_puts(PerlIO_stderr(),"panic: sprintf overflow - memory corrupted!\n"); my_exit(1);