replace (wrong) magic constant to idiom that calculates the right array size automatically.
authorRoker <roker@pep-project.org>
Mon, 18 Dec 2017 16:02:29 +0100
changeset 23225febb3fac06c
parent 2321 b71b768466e6
child 2328 33103198fcdc
child 2330 783d3b1eaa21
replace (wrong) magic constant to idiom that calculates the right array size automatically.
src/mime.c
     1.1 --- a/src/mime.c	Sat Dec 16 20:43:09 2017 +0100
     1.2 +++ b/src/mime.c	Mon Dec 18 16:02:29 2017 +0100
     1.3 @@ -100,7 +100,7 @@
     1.4  static bool known_ascii_type(const char* mime_type) {
     1.5      const char* text_types[] = {"application/pgp-keys",
     1.6                                  "application/pgp-encrypted"};
     1.7 -    const int TEXT_TYPE_ARRAY_SIZE = 3;
     1.8 +    const int TEXT_TYPE_ARRAY_SIZE = sizeof(text_types)/sizeof(text_types[0]);
     1.9      
    1.10      int i;
    1.11