- if ((smtp_response[0] == '1' || smtp_response[0] == '2' || smtp_response[0] == '3') &&
- smtp_response[3] == ' ')
+ strlcat(smtp_response, reply, sizeof(smtp_response));
+
+ if (strchr("123", reply[0])
+ && isdigit((unsigned char)reply[1])
+ && isdigit((unsigned char)reply[2])
+ && strchr(" ", reply[3])) /* matches space and \0 */ {