diff options
| author | Hiroshi Mimaki <[email protected]> | 2016-08-17 15:29:59 +0900 |
|---|---|---|
| committer | Hiroshi Mimaki <[email protected]> | 2016-08-17 15:29:59 +0900 |
| commit | 861b0eed7b3a2b8fae863affaf40936519c6964a (patch) | |
| tree | 086dda3296e3aa2c810dc21d2c071bad4f90e5b2 /mrbgems/mruby-string-ext/src/string.c | |
| parent | ee40f9bbbd5f4a3507b2d8a04b51a00dd38dcc1a (diff) | |
| download | mruby-861b0eed7b3a2b8fae863affaf40936519c6964a.tar.gz mruby-861b0eed7b3a2b8fae863affaf40936519c6964a.zip | |
Fix String#ord failure which return a negative value
Diffstat (limited to 'mrbgems/mruby-string-ext/src/string.c')
| -rw-r--r-- | mrbgems/mruby-string-ext/src/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-string-ext/src/string.c b/mrbgems/mruby-string-ext/src/string.c index c2ee1fc23..2a52d53b3 100644 --- a/mrbgems/mruby-string-ext/src/string.c +++ b/mrbgems/mruby-string-ext/src/string.c @@ -529,7 +529,7 @@ mrb_str_ord(mrb_state* mrb, mrb_value str) { if (RSTRING_LEN(str) == 0) mrb_raise(mrb, E_ARGUMENT_ERROR, "empty string"); - return mrb_fixnum_value(RSTRING_PTR(str)[0]); + return mrb_fixnum_value((unsigned char)RSTRING_PTR(str)[0]); } #endif |
