atd

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/atd
Log | Files | Refs

commit 7f4b04c97042b620810627475fe8b45c4eceae14
parent 4f3f7e57405383a6b1ebcaf935fe4274e85b7ef4
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Wed,  4 Aug 2021 15:03:23 -0500

atsim: write AT+CMGS out properly

Diffstat:
Matsim.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/atsim.c b/atsim.c @@ -73,6 +73,14 @@ int main() { fprintf(stderr, "failed to read from socket\n"); break; } + + if (fromsock[ret-1] == '\x1a') { + fromsock[ret-1] = '\n'; + char *place = memchr(fromsock, '\r', ret-2); + if (*place) + *place = '\n'; + } + write(STDOUT, fromsock, ret); }