1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* util.c (ruby_getcwd): the content of buf is uncertain and must

not be printed when getcwd(buf, size) has failed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2002-03-19 15:45:53 +00:00
parent 6d2e56ce7c
commit faac53f7ba
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Wed Mar 20 00:36:43 2002 Akinori MUSHA <knu@iDaemons.org>
* util.c (ruby_getcwd): the content of buf is uncertain and must
not be printed when getcwd(buf, size) has failed.
Mon Mar 18 22:19:52 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp> Mon Mar 18 22:19:52 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* ext/stringio/stringio.c (check_modifiable): wrong declaration. * ext/stringio/stringio.c (check_modifiable): wrong declaration.

2
util.c
View file

@ -642,7 +642,7 @@ ruby_getcwd()
char *buf = xmalloc(size); char *buf = xmalloc(size);
while (!getcwd(buf, size)) { while (!getcwd(buf, size)) {
if (errno != ERANGE) rb_sys_fail(buf); if (errno != ERANGE) rb_sys_fail(NULL);
size *= 2; size *= 2;
buf = xrealloc(buf, size); buf = xrealloc(buf, size);
} }