** Add 'str' to the buffer. If string is larger than the buffer space, ** push the string directly to the stack. */
| 451 | ** push the string directly to the stack. |
| 452 | */ |
| 453 | static void addstr2buff (BuffFS *buff, const char *str, size_t slen) { |
| 454 | if (slen <= BUFVFS) { /* does string fit into buffer? */ |
| 455 | char *bf = getbuff(buff, cast_int(slen)); |
| 456 | memcpy(bf, str, slen); /* add string to buffer */ |
| 457 | addsize(buff, cast_int(slen)); |
| 458 | } |
| 459 | else { /* string larger than buffer */ |
| 460 | clearbuff(buff); /* string comes after buffer's content */ |
| 461 | pushstr(buff, str, slen); /* push string */ |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | |
| 466 | /* |
no test coverage detected