nmps

simple network-based command-line rpg wrote in c99
git clone git://git.kocotian.pl/nmps.git
Log | Files | Refs | LICENSE

commit 5f236ae943c0a469a4461e12c0e739db34e7a6b5
parent 95a121ec55eefd268cfbe32151a69443456b1475
Author: kocotian <kocotian@kocotian.pl>
Date:   Sun,  6 Dec 2020 20:23:18 +0100

still fixin

Diffstat:
Mnmps | 0
Mnmps.c | 10++++++----
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/nmps b/nmps Binary files differ. diff --git a/nmps.c b/nmps.c @@ -14,7 +14,7 @@ #include "http.h" #include "util.c" -#define VERSION "a0.3.2" +#define VERSION "a0.3.3" extern void herror(const char *s); @@ -61,7 +61,7 @@ authorize(char *host, const char *port, char *username, char *password) static int command(char *command, char *args, char *host, char *port, char *beforeOutput) { - char *buffer, *truncbuf; + char *buffer, *truncbuf, exitAfter = 0; size_t reqsize; if (!(reqsize = request(host, atoi(port), command, args, &buffer))) return -1; @@ -71,14 +71,16 @@ command(char *command, char *args, char *host, char *port, char *beforeOutput) || (*truncbuf > 13 && *truncbuf < 24)) { /* steering sequences, reserved for simple comunication server -> client */ + if (*truncbuf == 4) /* temporary fix */ + exitAfter = *(++truncbuf); } printf("%s%s%c", beforeOutput, truncbuf, buffer[reqsize - 1] == '\n' || buffer[reqsize - 1] == 030 /* ASCII 030 on the end simply means: PLZ DON'T INSERT ENDL ON THE END!!1!1!!1 */ ? '\0' : '\n'); - if (*truncbuf == 4) /* temporary fix */ - exit(*(++truncbuf) - 1); + if (exitAfter) + exit(exitAfter - 1); free(buffer); return 0; }