From: Pasi Kallinen Date: Sat, 15 Dec 2012 17:42:54 +0000 (+0200) Subject: Virus: Fix dot command segfault X-Git-Tag: v1.6.1-roc-dev~70 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=d30dbda89737dd855d27611a8d6afecec03a4db4;p=dgamelaunch Virus: Fix dot command segfault --- diff --git a/virus.c b/virus.c index f96c5d4..1613d4d 100644 --- a/virus.c +++ b/virus.c @@ -2647,7 +2647,7 @@ static Byte *char_insert(Byte * p, Byte c) // insert the char c at 'p' p = text_hole_delete (p, p); // shrink buffer 1 char #ifdef BB_FEATURE_VI_DOT_CMD // also rmove char from last_modifying_cmd - if (strlen((char *) last_modifying_cmd) > 0) { + if (last_modifying_cmd && (strlen((char *) last_modifying_cmd) > 0)) { Byte *q; q = last_modifying_cmd;