| 765 | } |
| 766 | |
| 767 | static void |
| 768 | xmlSBufAddString(xmlSBuf *buf, const xmlChar *str, unsigned len) { |
| 769 | if (buf->max - buf->size < len) { |
| 770 | if (buf->code == XML_ERR_OK) |
| 771 | buf->code = XML_ERR_RESOURCE_LIMIT; |
| 772 | return; |
| 773 | } |
| 774 | |
| 775 | if (buf->cap - buf->size <= len) { |
| 776 | if (xmlSBufGrow(buf, len) < 0) |
| 777 | return; |
| 778 | } |
| 779 | |
| 780 | if (len > 0) |
| 781 | memcpy(buf->mem + buf->size, str, len); |
| 782 | buf->size += len; |
| 783 | } |
| 784 | |
| 785 | static void |
| 786 | xmlSBufAddCString(xmlSBuf *buf, const char *str, unsigned len) { |
no test coverage detected