summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-11 15:00:57 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-11 15:00:57 +0000
commitc5831f39267e836bab7d541fe1cb91231beab5f1 (patch)
tree6812f1f6ec7b8dba9273446ca11e44fcdd2dc657 /string.c
parent28d28e844e58d0f6f17866b4fae5db19cba805db (diff)
* string.c (rb_str_concat): set array element after definition
to fix compile error with Fujitsu C Compiler 5.6 on Solaris 10 on Sparc. [Bug #5878] [ruby-dev:45123] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index 55691d017c..9fd2480fd3 100644
--- a/string.c
+++ b/string.c
@@ -2093,7 +2093,8 @@ rb_str_concat(VALUE str1, VALUE str2)
if (enc == rb_usascii_encoding()) {
/* US-ASCII automatically extended to ASCII-8BIT */
- char buf[1] = {(char)code};
+ char buf[1];
+ buf[0] = (char)code;
if (code > 0xFF) {
rb_raise(rb_eRangeError, "%u out of char range", code);
}