Commit 504ea373 authored by Daniel Salzman's avatar Daniel Salzman

Merge branch 'nitpicks' into 'master'

add parameter check and improve doc-comments

See merge request !686
parents 13353acf a8267f35
......@@ -368,7 +368,7 @@ int knot_dname_align(const uint8_t **d1, uint8_t d1_labels,
*
* Maximum length of such a domain name is KNOT_DNAME_MAXLEN characters.
*
* \param dst Memory to store converted name into.
* \param dst Memory to store converted name into. dst[0] will contain the length.
* \param src Source domain name.
* \param pkt Source name packet (NULL if not any).
*
......
......@@ -376,7 +376,7 @@ static inline void knot_wire_set_opcode(uint8_t *packet, short opcode)
*
* \param packet Wire format of the packet.
*
* \return Flags with only the QR bit according to its setting in the packet.
* \return Nonzero for responses and zero for queries.
*/
static inline uint8_t knot_wire_get_qr(const uint8_t *packet)
{
......
......@@ -1756,6 +1756,10 @@ int knot_rrset_txt_dump_data(const knot_rrset_t *rrset,
}
const knot_rdata_t *rr_data = knot_rdataset_at(&rrset->rrs, pos);
if (rr_data == NULL) {
return KNOT_EINVAL; /* bad pos or rrset->rrs */
}
uint8_t *data = knot_rdata_data(rr_data);
uint16_t data_len = knot_rdata_rdlen(rr_data);
......
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