[M] Change in openvpn[master]: Add helper method to extra a field from a buffer

"plaisthos \(Code Review\) via Openvpn-devel" <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <b7809a1fc3bbf97d3cddfe2c2b4a8ae75a579a53-EmailReviewComments-HTML@gerrit.openvpn.net>
Attention is currently required from: cron2, razvanc.

plaisthos has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1855?usp=email )

Change subject: Add helper method to extra a field from a buffer
......................................................................


Patch Set 6:

(8 comments)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/1855/comment/30e8d51d_4a25b93d?usp=email :
PS6, Line 7: Add helper method to extra a field from a buffer
> Typo: "extract"
Done


File src/openvpn/buffer.h:

http://gerrit.openvpn.net/c/openvpn/+/1855/comment/07419209_4e236540?usp=email :
PS6, Line 2247:  * Extract a field from buf that end with the \c sep character. The
> Typo: "ends".
Done


http://gerrit.openvpn.net/c/openvpn/+/1855/comment/b545da4b_f16087b2?usp=email :
PS6, Line 2255: #endif /* BUFFER_H */
> Probably want a newline between the function name and `#endif`.
Done


File src/openvpn/buffer.c:

http://gerrit.openvpn.net/c/openvpn/+/1855/comment/b669dcc3_014be768?usp=email :
PS6, Line 1389: extract_field(struct buffer *buf, char sep, struct gc_arena *gc)
> Just a nitpick, and possibly wrong but just in case you think it's worth a think: most other functio […]
Done


http://gerrit.openvpn.net/c/openvpn/+/1855/comment/0ff47b8b_5240d8dc?usp=email :
PS6, Line 1391:     const uint8_t *seppos = memchr(BPTR(buf), sep, buf_len(buf));
> `BPTR(buf)` seems capable of returning `NULL`, so should we check we're not passing `NULL` to `memch […]
Done


http://gerrit.openvpn.net/c/openvpn/+/1855/comment/800b7982_7b1d4015?usp=email :
PS6, Line 1400:     strncpy(field, BSTR(buf), field_len);
> We already know the length (don't need to look for `NUL` characters anymore), so `memcpy(field, BPTR […]
Done


http://gerrit.openvpn.net/c/openvpn/+/1855/comment/a731563a_5dbba3a2?usp=email :
PS6, Line 1403:     buf_advance(buf, (int)field_len + 1);
> The `(int)` cast is unnecessary, `buf_advance()` already takes a `size_t` parameter there.
That happens when a patch sits almost 3 years in a branch .... That only changed last year.


http://gerrit.openvpn.net/c/openvpn/+/1855/comment/1347b60a_fb12a568?usp=email :
PS6, Line 1405: }
> Minor nitpick: this lost the trailing endline.
Done



-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1855?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifdd2122a3e60cdb11cc9df67570ab5628bfcdeea
Gerrit-Change-Number: 1855
Gerrit-PatchSet: 6
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-CC: cron2 <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: razvanc <[email protected]>
Gerrit-Attention: cron2 <[email protected]>
Gerrit-Attention: razvanc <[email protected]>
Gerrit-Comment-Date: Wed, 26 Aug 2026 15:21:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: razvanc <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.