diff options
| -rw-r--r-- | guththila/src/guththila_xml_parser.c | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/guththila/src/guththila_xml_parser.c b/guththila/src/guththila_xml_parser.c index f48572f..90598bf 100644 --- a/guththila/src/guththila_xml_parser.c +++ b/guththila/src/guththila_xml_parser.c @@ -1773,8 +1773,8 @@ guththila_next_no_char(      }      else if(m->reader->type == GUTHTHILA_IO_READER || m->reader->type == GUTHTHILA_FILE_READER)      { -        if(m->next < GUTHTHILA_BUFFER_PRE_DATA_SIZE(m->buffer) -            + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(m->buffer) + no && m->buffer.cur_buff != -1) +        if(m->next + no <= GUTHTHILA_BUFFER_PRE_DATA_SIZE(m->buffer) +            + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(m->buffer) && m->buffer.cur_buff != -1)           {              for(i = 0; i < no; i++)              { @@ -1784,8 +1784,8 @@ guththila_next_no_char(              return (int)no;              /* We are sure that the difference lies within the int range */          } -        else if(m->next >= GUTHTHILA_BUFFER_PRE_DATA_SIZE(m->buffer) -            + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(m->buffer) + no && m->buffer.cur_buff != -1) +        else if(m->next + no > GUTHTHILA_BUFFER_PRE_DATA_SIZE(m->buffer) +            + GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(m->buffer) && m->buffer.cur_buff != -1)           {              /* We are sure that the difference lies within the int range */              if(m->buffer.cur_buff == (int)m->buffer.no_buffers - 1)  | 
