Permalink
Browse files

(rdfa_init_base): Calculate buffer expansion correctly

Pulled from newer RDFA git
  • Loading branch information...
1 parent 420551c commit e58d24b9069b2dd7334d051813c01302ed9936f8 @dajobe committed May 16, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 librdfa/rdfa.c
View
@@ -134,7 +134,12 @@ static size_t rdfa_init_base(
{
char* head_end = NULL;
size_t offset = context->wb_position;
- size_t needed_size = (offset + bytes_read) - *working_buffer_size;
+ size_t needed_size = 0;
+
+ if((offset + bytes_read) > *working_buffer_size)
+ {
+ needed_size = (offset + bytes_read) - *working_buffer_size;
+ }
// search for the end of <head>, stop if <head> was found

0 comments on commit e58d24b

Please sign in to comment.