0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.0977: blob not tested with Ruby

Problem:    Blob not tested with Ruby.
Solution:   Add more test coverage.  fixes a crash. (Dominique Pelle,
            closes #4036)
This commit is contained in:
Bram Moolenaar
2019-02-23 14:23:03 +01:00
parent e4963c543d
commit 0d13cce345
3 changed files with 13 additions and 1 deletions

View File

@@ -1267,7 +1267,7 @@ static VALUE vim_blob(VALUE self UNUSED, VALUE str)
int i;
for (i = 0; i < RSTRING_LEN(str); i++)
{
sprintf(buf, "%02X", RSTRING_PTR(str)[i]);
sprintf(buf, "%02X", (unsigned char)(RSTRING_PTR(str)[i]));
rb_str_concat(result, rb_str_new2(buf));
}
return result;