It's safer to return an empty string rather than NULL for missing
header values.
return decoded_value;
if (message->parsing_finished)
- return NULL;
+ return "";
#define NEXT_HEADER_LINE(closure) \
while (1) { \
header_desired);
}
- return NULL;
+ return "";
}
* modified or freed by the caller (nor should it be referenced after
* the message is destroyed).
*
- * Returns NULL if the message does not contain a header line matching
- * 'header' of if any error occurs.
+ * Returns an empty string ("") if the message does not contain a
+ * header line matching 'header'. Returns NULL if any error occurs.
*/
const char *
notmuch_message_get_header (notmuch_message_t *message, const char *header);