** Add 'str' to the buffer. If string is larger than the buffer space, ** push the string directly to the stack. */
| 441 | ** push the string directly to the stack. |
| 442 | */ |
| 443 | static void addstr2buff (BuffFS *buff, const char *str, size_t slen) { |
| 444 | if (slen <= BUFVFS) { /* does string fit into buffer? */ |
| 445 | char *bf = getbuff(buff, cast_int(slen)); |
| 446 | memcpy(bf, str, slen); /* add string to buffer */ |
| 447 | addsize(buff, cast_int(slen)); |
| 448 | } |
| 449 | else { /* string larger than buffer */ |
| 450 | clearbuff(buff); /* string comes after buffer's content */ |
| 451 | pushstr(buff, str, slen); /* push string */ |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | |
| 456 | /* |
no test coverage detected