Author: dgorbachev
Date: Sat May 12 03:12:49 2007
New Revision: 26707
URL:
http://svn.reactos.org/svn/reactos?rev=26707&view=rev
Log:
Do not fail with less then two arguments.
Modified:
trunk/reactos/base/applications/cmdutils/more/more.c
Modified: trunk/reactos/base/applications/cmdutils/more/more.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/more.c (original)
+++ trunk/reactos/base/applications/cmdutils/more/more.c Sat May 12 03:12:49 2007
@@ -79,8 +79,8 @@
rdtscll(timeStart);
- randfile = fopen(argv[1],"r");
- sortfile = fopen(argv[2],"w");
+ randfile = (argc < 2) ? stdin : fopen(argv[1],"r");
+ sortfile = (argc < 3) ? stdout : fopen(argv[2],"w");
if (randfile == NULL || sortfile == NULL) {
fprintf(stderr,"Could not open all files.\n");
return 1;