tng         2002/11/01 14:05:44

  Modified:    c/samples/SAXCount SAXCount.cpp
  Log:
  Samples/Test update: Issue error if the list file failed to open.
  
  Revision  Changes    Path
  1.23      +10 -2     xml-xerces/c/samples/SAXCount/SAXCount.cpp
  
  Index: SAXCount.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/SAXCount/SAXCount.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- SAXCount.cpp      27 Sep 2002 19:25:10 -0000      1.22
  +++ SAXCount.cpp      1 Nov 2002 22:05:44 -0000       1.23
  @@ -56,6 +56,9 @@
   
   /*
   * $Log$
  +* Revision 1.23  2002/11/01 22:05:44  tng
  +* Samples/Test update: Issue error if the list file failed to open.
  +*
   * Revision 1.22  2002/09/27 19:25:10  tng
   * Samples Fix: wrong length in memset
   *
  @@ -310,13 +313,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 (true)
       {
           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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to