From 39b14c177e0560e09c12e2343aad267a67831768 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Fri, 18 Mar 2011 16:28:21 +0000 Subject: [PATCH] [Y] - Fix argument checking - Close correct handle - Patch by Kuts Alexey - bug 6004 svn path=/trunk/; revision=51087 --- rosapps/applications/cmdutils/y/y.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rosapps/applications/cmdutils/y/y.c b/rosapps/applications/cmdutils/y/y.c index c048d85f067..1e052bdbb51 100644 --- a/rosapps/applications/cmdutils/y/y.c +++ b/rosapps/applications/cmdutils/y/y.c @@ -53,7 +53,7 @@ int main (int argc, char **argv) hConsoleIn = GetStdHandle(STD_INPUT_HANDLE); hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE); - if (_tcsncmp (argv[1], _T("/?"), 2) == 0) + if (argc == 2 && _tcsncmp (argv[1], _T("/?"), 2) == 0) { ConOutPuts(_T("copy stdin to stdout and then files to stdout\n" "\n" @@ -115,7 +115,7 @@ int main (int argc, char **argv) } while(FindNextFile(hFind,&FindData)); - FindClose(hFile); + FindClose(hFind); } return 0;