Ensure *ptr is not null byte

This commit is contained in:
pancake 2018-03-23 14:56:54 +01:00
parent 76d2650bd7
commit 06d7b89d18

View File

@ -2061,7 +2061,7 @@ static int r_core_cmd_subst_i(RCore *core, char *cmd, char *colon) {
/* bool conditions */
ptr = (char *)r_str_lastbut (cmd, '&', quotestr);
//ptr = strchr (cmd, '&');
while (ptr && ptr[1] == '&') {
while (ptr && *ptr && ptr[1] == '&') {
*ptr = '\0';
ret = r_cmd_call (core->rcmd, cmd);
if (ret == -1) {