* xmlBufGrow: * @buf: the buffer * @len: the minimum free size to allocate * * Grow the available space of an XML buffer, @len is the target value * This is been kept compatible with xmlBufferGrow() as much as possible * * Returns -1 in case of error or the length made available otherwise */
| 440 | * Returns -1 in case of error or the length made available otherwise |
| 441 | */ |
| 442 | int |
| 443 | xmlBufGrow(xmlBufPtr buf, int len) { |
| 444 | size_t ret; |
| 445 | |
| 446 | if ((buf == NULL) || (len < 0)) return(-1); |
| 447 | if (len == 0) |
| 448 | return(0); |
| 449 | ret = xmlBufGrowInternal(buf, len); |
| 450 | if (buf->error != 0) |
| 451 | return(-1); |
| 452 | return(ret > INT_MAX ? INT_MAX : ret); |
| 453 | } |
| 454 | |
| 455 | /** |
| 456 | * xmlBufDump: |
no test coverage detected