dbertoni    02/05/02 23:29:21

  Modified:    c/Tests/Harness XMLFileReporter.cpp FileUtility.cpp
  Log:
  Use puts instead of printf.  Cleaned up creation of drive string.
  
  Revision  Changes    Path
  1.14      +16 -12    xml-xalan/c/Tests/Harness/XMLFileReporter.cpp
  
  Index: XMLFileReporter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/Tests/Harness/XMLFileReporter.cpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XMLFileReporter.cpp       22 Jan 2002 18:47:59 -0000      1.13
  +++ XMLFileReporter.cpp       3 May 2002 06:29:21 -0000       1.14
  @@ -628,38 +628,42 @@
   bool 
   XMLFileReporter::closeResultsFile()
   {
  -    if (isReady())
  +    if (isReady() == false)
  +     {
  +        return false;
  +     }
  +     else
       {            
                printToFile("</" + ELEM_RESULTSFILE + ">");
           return true;
       }
  -    else
  -        return false;
   }
   
   
   bool 
   XMLFileReporter::printToFile(const XalanDOMString&   output) 
   {
  -     CharVectorType  theResult(TranscodeToLocalCodePage(output));
  -
  -    if (isReady())
  +    if (isReady() == false)
  +     {
  +             return false;
  +     }
  +     else
       {
  +             CharVectorType  theResult(TranscodeToLocalCodePage(output));
  +
                if(!theResult.size())
                {
  -                     fprintf(m_fileHandle, "Error transcoding text to local 
codepage");
  -                     fprintf(m_fileHandle, "\n");
  +                     fputs("Error transcoding text to local codepage", 
m_fileHandle);
                }
                else 
                {
  -                     fprintf(m_fileHandle, c_str(theResult));
  -                     fprintf(m_fileHandle, "\n");
  +                     fputs(c_str(theResult), m_fileHandle);
                }
   
  +             fputs("\n", m_fileHandle);
  +
           return true;
       }
  -    else
  -        return false;
   }
   
   
  
  
  
  1.36      +7 -10     xml-xalan/c/Tests/Harness/FileUtility.cpp
  
  Index: FileUtility.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/Tests/Harness/FileUtility.cpp,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- FileUtility.cpp   10 Apr 2002 05:32:31 -0000      1.35
  +++ FileUtility.cpp   3 May 2002 06:29:21 -0000       1.36
  @@ -220,17 +220,14 @@
   XalanDOMString
   FileUtility::getDrive()
   {
  -     char temp[2];
  +     const char temp[] =
  +     {
  +             char(_getdrive() + 'A' - 1),
  +             ':',
  +             '\0'
  +     };
        
  -     // This query of the base drive is Window's specific. At some point 
it'll need to be IFDEF'ed for 
  -     // other platforms.  It is needed to set up the base-URL for the 
stylesheet that processes the results
  -     // of the conformance tests cconf.xsl found in 
\\xml-xalan\\c\\Tests\\cconf.xsl
  -
  -     int drv = _getdrive();
  -     sprintf( temp, "%c:", drv + 'A' - 1 );
  -
  -     return XalanDOMString(temp);
  -
  +     return XalanDOMString(temp, sizeof(temp) - 1);
   }
   #endif
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to