ref: ae93b05f1d2454bf04ddcaa32f59859bebe49526
parent: c6d36e11722d0f4586494886de092dc6ee368915
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sun May 17 20:01:17 EDT 2020
remove cr/lf
--- a/main.c
+++ b/main.c
@@ -129,7 +129,9 @@
goto err;
}
if((len = Blinelen(&r->body)) > 0)
- s[len-1] = 0;
+ s[--len] = 0;
+ for(len--; len >= 0 && (s[len] == '\r' || s[len] == '\n'); len--)
+ s[len] = 0;
if(s[0] < '0' || s[0] > '9' || s[1] < '0' || s[1] > '9'){
werrstr("invalid status");
goto err;