*** scstring.cpp	2011-01-26 16:37:47.912337198 +0100
--- scstring.cpp.orig	2011-01-26 16:36:44.786537052 +0100
***************
*** 140,164 ****
  {
    va_list ap;
    va_start( ap, format );
! 
!   // first pass, determine required number of characters
!   int required_l = vsnprintf( NULL, 0, format, ap );
!   // XXX note that the call could fail by returning < 0
!   // which is not handled here explicitly
!   // null terminator add
!   required_l++;
! 
!   const uint l = length();
!   if (l<required_l)
    {
!     if (m_data)
!       m_data = (char *)realloc(m_data,required_l);
      else
!       m_data = (char *)malloc(required_l);
    }
! 
!   vsnprintf( m_data, required_l, format, ap );
!   //resize( qstrlen(m_data) + 1 );              // truncate
    va_end( ap );
    return *this;
  }
--- 140,156 ----
  {
    va_list ap;
    va_start( ap, format );
!   uint l = length();
!   const uint minlen=256;
!   if (l<minlen)
    {
!     if (m_data) 
!       m_data = (char *)realloc(m_data,minlen);
      else
!       m_data = (char *)malloc(minlen);
    }
!   vsprintf( m_data, format, ap );
!   resize( qstrlen(m_data) + 1 );              // truncate
    va_end( ap );
    return *this;
  }
