diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-02-20 09:22:13 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-02-20 09:22:13 -0500 |
| commit | 525a545e62c97c1ed5335d6ce5750341c5ba877e (patch) | |
| tree | ab12235d819eea3186ede624d3367d920f0688fc | |
| parent | 0b932be4648d99d57319f597386ec98f4ac4f055 (diff) | |
| download | fujinet-chat-525a545e62c97c1ed5335d6ce5750341c5ba877e.tar.gz | |
always EOL-terminate transmit buffer.
| -rw-r--r-- | src/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -70,7 +70,13 @@ void txbuf_set_str(const char *str) { } void txbuf_send(void) { + /* don't sent empty buffer */ if(!txbuflen) return; + + /* always terminate with EOL */ + if(tx_buf[txbuflen - 1] != '\n') + tx_buf[txbuflen++] = '\n'; + nwrite(url, tx_buf, txbuflen); txbuf_init(); } |
