Bugzilla – Bug 829
doc of sldns_wire2str_rdata_buf() return value has an off-by-one typo
Last modified: 2016-09-05 09:16:20 CEST
In sldns/wire2str.h, the description of sldns_wire2str_type_buf() says:
* @return the number of characters for this element, excluding zerobyte.
* Is larger than str_len if output was truncated.
This is slightly incorrect. In fact it can also return 'str_len' when
truncation happens. No truncation is ensured only when @return < 'str_len'.
I suspect the description of some other of '2str' functions have the same error.
Thank you for the report.
I have changed it so 'larger or equal' in the text. I hope it is then correct, you are right it needs unused space in the buffer to ensure it was not truncated.
(also changed for the other occurrences of this text in the header file).
Best regards, Wouter