dbertoni    00/05/08 10:23:59

  Modified:    c/src/XMLSupport FormatterToXML.cpp
  Log:
  Added a workaround so DOMString will still have a valid buffer if the length 
is 0.
  
  Revision  Changes    Path
  1.16      +10 -3     xml-xalan/c/src/XMLSupport/FormatterToXML.cpp
  
  Index: FormatterToXML.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- FormatterToXML.cpp        2000/04/20 16:41:41     1.15
  +++ FormatterToXML.cpp        2000/05/08 17:23:59     1.16
  @@ -843,7 +843,7 @@
   
        vector<XalanDOMChar> vec;
   
  -     vec.reserve(theLength*2);
  +     vec.reserve(theLength * 2);
   
        for (unsigned int i = 0;  i < theLength;  i ++) 
        {
  @@ -917,9 +917,16 @@
                }
        }
   
  -     vec.push_back('\0');
  +     vec.push_back(0);
   
  -     return XalanDOMString(vec.begin());
  +     if (vec.size() == 1)
  +     {
  +             // Uh oh, we have to fake out XalanDOMString and
  +             // give it an extra null...
  +             vec.push_back(0);
  +     }
  +
  +     return XalanDOMString(vec.begin(), vec.size() - 1);
   }
   
   
  
  
  

Reply via email to