From 12c506c89af62006d7632297a5240ef11a7629bd Mon Sep 17 00:00:00 2001 From: Vatiken Date: Mon, 18 Jun 2012 23:58:36 +0000 Subject: [PATCH] Fixed crash bug when attempting to use the improved editor's toggle function without a string --- src/improved-edit.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/improved-edit.c b/src/improved-edit.c index c0f527a..43d1677 100644 --- a/src/improved-edit.c +++ b/src/improved-edit.c @@ -125,6 +125,10 @@ void parse_edit_action(int command, char *string, struct descriptor_data *d) "/s - saves text\r\n"); break; case PARSE_TOGGLE: + if (!*d->str) { + write_to_output(d, "No string.\r\n"); + break; + } if (strchr(*d->str, '@')) { parse_at(*d->str); write_to_output(d, "Toggling (at) into (tab) Characters...\r\n");