Patch Set 1:

size is the original buffer size, number of bytes you can fit into the buffer 
you provide.

len is the number of byte that has been written into the buffer.

offset is where you should continue to append more bytes.

If you want to retain snprintf semantics, ie. return the number of bytes that 
would have been written, then you need to keep size and offset, because offset 
should not ever go over the boundary.

Retaining snprintf semantics can be good to log how many bytes are missing in 
the buffer you provide.

If you don't want snprintf semantics, then you can remove len and use offset in 
any case.

-- 
To view, visit https://gerrit.osmocom.org/3537
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Holger Freyther <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso <[email protected]>
Gerrit-HasComments: No

Reply via email to