Jorgen Sigvardsson wrote:
> 
> In QLineEditBuf I have a member function called 'grow()' wich is called
> whenever the char-buffer needs to grow. It looks like this:

I'm not sure how the different methods interact, but your 
shiftBufferRight doesn't look right:

  while(where + how_much > m_bufsize)
    grow();

  // Move chunk
  memmove(m_buf + where + how_much, m_buf + where, how_much);
 
memmove() moves how_much bytes to m_buf+where+how_much. So the
buffer must have where+how_much+how_much bytes allocated. I don't
see how this is guaranteed. 

BTW: In operator[], why do you check against m_bufsize and not
against m_glyphsused?

Bernd.

Reply via email to