diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-06 16:50:50 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-06 16:50:50 +0000 |
commit | c63b718feaf10c8c3222f309da05d506370eb085 (patch) | |
tree | e808ff5864db241d6d4ba9fe5fdf12de5efa00c9 /io.c | |
parent | 472a49b666ae8444b13120749923ec29bc29851f (diff) |
* io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.
fixed [ruby-dev:34979]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -3396,7 +3396,8 @@ rb_open_file(argc, argv, io) { VALUE fname, vmode, perm; const char *path, *mode; - int flags, fmode; + int flags; + unsigned int fmode; rb_scan_args(argc, argv, "12", &fname, &vmode, &perm); SafeStringValue(fname); @@ -3410,7 +3411,7 @@ rb_open_file(argc, argv, io) SafeStringValue(vmode); flags = rb_io_mode_modenum(RSTRING(vmode)->ptr); } - fmode = NIL_P(perm) ? 0666 : NUM2INT(perm); + fmode = NIL_P(perm) ? 0666 : NUM2UINT(perm); rb_file_sysopen_internal(io, path, flags, fmode); } @@ -3466,7 +3467,8 @@ rb_io_s_sysopen(argc, argv) VALUE *argv; { VALUE fname, vmode, perm; - int flags, fmode, fd; + int flags, fd; + unsigned int fmode; char *path; rb_scan_args(argc, argv, "12", &fname, &vmode, &perm); @@ -3479,7 +3481,7 @@ rb_io_s_sysopen(argc, argv) flags = rb_io_mode_modenum(RSTRING(vmode)->ptr); } if (NIL_P(perm)) fmode = 0666; - else fmode = NUM2INT(perm); + else fmode = NUM2UINT(perm); path = ALLOCA_N(char, strlen(RSTRING(fname)->ptr)+1); strcpy(path, RSTRING(fname)->ptr); |