From 8fdfbb5bd044b3870b0b35629deb5e2887b95cfe Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Mon, 4 Jul 2016 21:04:00 +0000 Subject: [PATCH] [SC] - Fix buggy actions parser. - Use proper NUL character instead of zero. svn path=/trunk/; revision=71813 --- reactos/base/applications/sc/misc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/base/applications/sc/misc.c b/reactos/base/applications/sc/misc.c index ebbe96f62b3..e03aea49672 100644 --- a/reactos/base/applications/sc/misc.c +++ b/reactos/base/applications/sc/misc.c @@ -189,16 +189,16 @@ ParseFailureActions( /* Replace all slashes by null characters */ p = pStringBuffer; - while (*p != 0 /*_T('\0')*/) + while (*p != _T('\0')) { if (*p == _T('/')) - *p = 0; //_T('\0'); + *p = _T('\0'); p++; } /* Count the arguments in the buffer */ p = pStringBuffer; - while (*p != 0 /*_T('\0')*/) + while (*p != _T('\0')) { nCount++; @@ -224,11 +224,11 @@ ParseFailureActions( if (nCount % 2 == 0) { /* Action */ - if (_tcsicmp(p, _T("reboot"))) + if (!lstrcmpi(p, _T("reboot"))) pActions[nCount / 2].Type = SC_ACTION_REBOOT; - else if (_tcsicmp(p, _T("restart"))) + else if (!lstrcmpi(p, _T("restart"))) pActions[nCount / 2].Type = SC_ACTION_RESTART; - else if (_tcsicmp(p, _T("run"))) + else if (!lstrcmpi(p, _T("run"))) pActions[nCount / 2].Type = SC_ACTION_RUN_COMMAND; else break; @@ -262,7 +262,7 @@ ParseFailureArguments( OUT LPCTSTR *ppServiceName, OUT LPSERVICE_FAILURE_ACTIONS pFailureActions) { - INT /*i,*/ ArgIndex = 1; + INT ArgIndex = 1; LPCTSTR lpActions = NULL; LPCTSTR lpReset = NULL;