Remove the returns in the function to end directly at the end label.
/* there is no end to this command, need more to parse ! */
if (!reql || *(end-1) != '\n') {
- return -1;
+ ret = -1;
+ goto end;
}
if (s->pcli_flags & PCLI_F_PAYLOAD) {
if (reql == 1) /* last line of the payload */
s->pcli_flags &= ~PCLI_F_PAYLOAD;
- return reql;
+ ret = reql;
+ goto end;
}
*(end-1) = '\0';
ret = end - trim;
} else if (wtrim < 0) {
/* parsing error */
- return -1;
+ ret = -1;
+ goto end;
} else {
/* the whole string */
ret = end - str;