- HTTP_INFO(info).response.code = (code && (end > code)) ? strtol(code, &status, 10) : 0;
- HTTP_INFO(info).response.status = (status && (end > ++status)) ? estrndup(status, end - status) : ecalloc(1,1);
+ while (' ' == *code) ++code;
+ if (code && end > code) {
+ HTTP_INFO(info).response.code = strtol(code, &status, 10);
+ } else {
+ HTTP_INFO(info).response.code = 0;
+ }
+ if (status && end > status) {
+ while (' ' == *status) ++status;
+ HTTP_INFO(info).response.status = estrndup(status, end - status);
+ } else {
+ HTTP_INFO(info).response.status = NULL;
+ }