gods

a simple blocklist for ssh
Log | Files | Refs | README | LICENSE

commit b8ff2a6a631e2d117a08b46d6580136e823fe785
parent d3dbd0e9f933b092aa4a744eef717794e4aa03f2
Author: Naveen Narayanan <zerous@nocebo.space>
Date:   Sat, 18 Sep 2021 16:54:39 +0200

Parse connection status

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

diff --git a/parser.c b/parser.c @@ -249,6 +249,26 @@ procid() static int constat() { + char str[128]; + char *sp = str; + + while (word()) { + if (*tp) { + printf("tp: %c\n", *tp); + if (isdigit(*tp) && isip(tp)) { + undoword(); + break; + } + for (; *tp; ) + *sp++ = *tp++; + } + *sp++ = ' '; + } + *sp = '\0'; + + if (sp == str) + return 0; + printf("constat ok: %s\n", str); return 1; }