1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 17:43:13 +02:00

Fix fgets re-allocation (add +1 to accomondate ending \0).

This commit is contained in:
Stanislav Malyshev
2000-07-07 09:06:47 +00:00
parent 6ace712438
commit 4d41c8ba49

View File

@@ -993,7 +993,7 @@ PHP_FUNCTION(fgets)
return_value->value.str.len = strlen(return_value->value.str.val);
/* resize buffer if it's much larger than the result */
if(return_value->value.str.len < len/2) {
return_value->value.str.val = erealloc(buf,return_value->value.str.len);
return_value->value.str.val = erealloc(buf,return_value->value.str.len+1);
}
}
return_value->type = IS_STRING;