Skip to content

Commit

Permalink
lib-smtp: smtp-server-cmd-vrfy - Restructure parameter parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch authored and sirainen committed Apr 1, 2020
1 parent 0da0eff commit d143ca6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib-smtp/smtp-server-cmd-vrfy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ void smtp_server_cmd_vrfy(struct smtp_server_cmd_ctx *cmd,
int ret;

/* vrfy = "VRFY" SP String CRLF */
if ((ret=smtp_string_parse(params, &param, &error)) <= 0) {
if (ret < 0) {
smtp_server_reply(cmd,
501, "5.5.4",
"Invalid string parameter: %s", error);
} else {
smtp_server_reply(cmd,
501, "5.5.4", "Invalid parameters");
}
ret = smtp_string_parse(params, &param, &error);
if (ret < 0) {
smtp_server_reply(cmd, 501, "5.5.4",
"Invalid string parameter: %s", error);
return;
} else if (ret == 0) {
smtp_server_reply(cmd, 501, "5.5.4", "Invalid parameters");
return;
}

Expand Down

0 comments on commit d143ca6

Please sign in to comment.