diff src/if_ruby.c @ 15943:e5f82e8b3c06 v8.1.0977

patch 8.1.0977: blob not tested with Ruby commit https://github.com/vim/vim/commit/0d13cce3453b2274c93c5015faa1993baaebace9 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 23 14:23:03 2019 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Sat, 23 Feb 2019 14:30:11 +0100
parents 8fb7dd311ca7
children 518f44125207
line wrap: on
line diff
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -1267,7 +1267,7 @@ static VALUE vim_blob(VALUE self UNUSED,
     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;