You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/11/01 23:05:34 UTC

cvs commit: xml-xerces/c/samples/DOMCount DOMCount.cpp

tng         2002/11/01 14:05:34

  Modified:    c/samples/DOMCount DOMCount.cpp
  Log:
  Samples/Test update: Issue error if the list file failed to open.
  
  Revision  Changes    Path
  1.29      +8 -6      xml-xerces/c/samples/DOMCount/DOMCount.cpp
  
  Index: DOMCount.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/DOMCount/DOMCount.cpp,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- DOMCount.cpp	27 Sep 2002 19:24:36 -0000	1.28
  +++ DOMCount.cpp	1 Nov 2002 22:05:34 -0000	1.29
  @@ -78,8 +78,6 @@
   #include <fstream.h>
   
   
  -
  -
   // ---------------------------------------------------------------------------
   //  This is a simple program which invokes the DOMParser to build a DOM
   //  tree for the specified input file. It then walks the tree and counts
  @@ -123,7 +121,6 @@
       return count;
   }
   
  -
   // ---------------------------------------------------------------------------
   //
   //   main
  @@ -278,13 +275,18 @@
   
       // the input is a list file
       if (doList)
  -        fin.open(argV[argInd]);
  +        fin.open(argV[argInd],ios::nocreate);
  +
  +    if (fin.fail()) {
  +        cerr <<"Cannot open the list file: " << argV[argInd] << endl;
  +        return 2;
  +    }
   
       while (more)
       {
           char fURI[1000];
           //initialize the array to zeros
  -        memset(fURI,0,strlen(fURI));
  +        memset(fURI,0,sizeof(fURI));
   
           if (doList) {
               if (! fin.eof() ) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org