From c19d6a953f1fa0b9b232eae24b7c6e3b8568d9c3 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 5 Apr 2002 12:53:21 +0000 Subject: [PATCH] Fixed crash in environment variable evaluation. svn path=/trunk/; revision=2822 --- rosapps/cmd/cmd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rosapps/cmd/cmd.c b/rosapps/cmd/cmd.c index 5a5ee3a6506..f24567e466f 100644 --- a/rosapps/cmd/cmd.c +++ b/rosapps/cmd/cmd.c @@ -1,4 +1,4 @@ -/* $Id: cmd.c,v 1.28 2001/10/14 18:30:28 phreak Exp $ +/* $Id: cmd.c,v 1.29 2002/04/05 12:53:21 ekohl Exp $ * * CMD.C - command-line interface. * @@ -768,8 +768,9 @@ ProcessInput (BOOL bFlag) break; default: - if ((tp == _tcschr(ip, _T('%'))) && - (tp <= _tcschr(ip, _T(' '))-1)) + tp = _tcschr(ip, _T('%')); + if ((tp != NULL) && + (tp <= _tcschr(ip, _T(' ')) - 1)) { char evar[512]; *tp = _T('\0');