Permalink
Browse files

Directly output to stream char-casted integers in String::tr_expand

  • Loading branch information...
1 parent 1cfcb61 commit 368ba2fba158ee491ab4e71452e9fa64798b9985 Michal Bugno committed Apr 13, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 vm/builtin/string.cpp
View
@@ -1022,9 +1022,7 @@ namespace rubinius {
} else {
std::stringstream ss;
if (isprint(chr) && isprint(max)) {
- char buffer[3];
- sprintf(buffer, "%c-%c", (char)chr, (char)max);
- ss << "invalid range \"" << std::string(buffer) << "\" in string transliteration";
+ ss << "invalid range \"" << (char)chr << "-" << (char)max << "\" in string transliteration";
} else {
ss << "invalid range in string transliteration";
}

0 comments on commit 368ba2f

Please sign in to comment.