** Add 'str' to the buffer. If string is larger than the buffer space, ** push the string directly to the stack. */
| 431 | ** push the string directly to the stack. |
| 432 | */ |
| 433 | static void addstr2buff (BuffFS *buff, const char *str, size_t slen) { |
| 434 | if (slen <= BUFVFS) { /* does string fit into buffer? */ |
| 435 | char *bf = getbuff(buff, cast_int(slen)); |
| 436 | memcpy(bf, str, slen); /* add string to buffer */ |
| 437 | addsize(buff, cast_int(slen)); |
| 438 | } |
| 439 | else { /* string larger than buffer */ |
| 440 | clearbuff(buff); /* string comes after buffer's content */ |
| 441 | pushstr(buff, str, slen); /* push string */ |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | |
| 446 | /* |
no test coverage detected