Commit 4be05500 authored by David Gibson's avatar David Gibson

rfc822: Rename RFC822_HDR_BAD_NAME constant

This error constant is actually more specific than the name suggests - it
indicates that a header field name contains characters which are not
permitted in a header field name.  Rename the constant to better reflect
this, likewise rename the testcase based around it.
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent cd901665
...@@ -257,7 +257,7 @@ enum rfc822_header_errors rfc822_header_errors(struct rfc822_msg *msg, ...@@ -257,7 +257,7 @@ enum rfc822_header_errors rfc822_header_errors(struct rfc822_msg *msg,
assert(c != ':'); assert(c != ':');
if ((c < 33) || (c > 126)) { if ((c < 33) || (c > 126)) {
err |= RFC822_HDR_BAD_NAME; err |= RFC822_HDR_BAD_NAME_CHARS;
break; break;
} }
} }
......
...@@ -117,7 +117,7 @@ struct bytestring rfc822_body(struct rfc822_msg *msg); ...@@ -117,7 +117,7 @@ struct bytestring rfc822_body(struct rfc822_msg *msg);
enum rfc822_header_errors { enum rfc822_header_errors {
RFC822_HDR_NO_COLON = 1, RFC822_HDR_NO_COLON = 1,
RFC822_HDR_BAD_NAME = 2, RFC822_HDR_BAD_NAME_CHARS = 2,
}; };
enum rfc822_header_errors rfc822_header_errors(struct rfc822_msg *msg, enum rfc822_header_errors rfc822_header_errors(struct rfc822_msg *msg,
......
...@@ -40,7 +40,7 @@ static bool bad_name(const char *buf, char c) ...@@ -40,7 +40,7 @@ static bool bad_name(const char *buf, char c)
allocation_failure_check(); allocation_failure_check();
ok1(!(errs & ~RFC822_HDR_BAD_NAME)); ok1(!(errs & ~RFC822_HDR_BAD_NAME_CHARS));
/* Check raw_name still works properly */ /* Check raw_name still works properly */
hname = rfc822_header_raw_name(msg, hdr); hname = rfc822_header_raw_name(msg, hdr);
...@@ -55,7 +55,7 @@ static bool bad_name(const char *buf, char c) ...@@ -55,7 +55,7 @@ static bool bad_name(const char *buf, char c)
allocation_failure_check(); allocation_failure_check();
return !!(errs & RFC822_HDR_BAD_NAME); return !!(errs & RFC822_HDR_BAD_NAME_CHARS);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment