Browse Source

Additional pointer check

Serj Kalichev 10 years ago
parent
commit
f05ade5e41
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tinyrl/tinyrl.c

+ 1 - 1
tinyrl/tinyrl.c

@@ -945,7 +945,7 @@ static char *internal_readline(tinyrl_t * this,
 		}
 		/* If the last character in the line (other than NULL)
 		   is a space remove it. */
-		if (this->end && isspace(this->line[this->end - 1]))
+		if (this->end && this->line && isspace(this->line[this->end - 1]))
 			tinyrl_delete_text(this, this->end - 1, this->end);
 		/* Restores the terminal mode */
 		tty_restore_mode(this);