This will be used momentarily to support quoting strings that aren't
guaranteed to be NUL terminated, but may have a length we can use.
Details
- Reviewers
imp adrian cy pauamma_gundo.com - Group Reviewers
manpages
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 44749 Build 41637: arc lint + arc unit
Event Timeline
sys/kern/subr_bus.c | ||
---|---|---|
904 | Nah, if an ssid contains non-printable characters (< ' ') we typically resort to hex output for the entire ssid -- and we do resort to hex output in the future caller. |
On second thought, please update devctl_safe_quote_sb.9 for this alternative interface.
share/man/man9/devctl_safe_quote_sb.9 | ||
---|---|---|
52 | Or maybe "a quoted string". | |
57–59 | My C is very rusty, but the source code, to me, reads like len is applied to the source string, not the buffer, which would have to hold up to 2*len characters, for a string that contains only \ or " characters. Can you clarify which is intended? |
share/man/man9/devctl_safe_quote_sb.9 | ||
---|---|---|
57–59 |
That bit of the manual page says that len is a limit applied to the buffer. My (admittedly very rusty) C tells me the source code is applying that limit to the source string. You said the buffer doesn't need it, and that's consistent with how I read the source code, but the inconsistency with the manual page still needs to be addressed. |
share/man/man9/devctl_safe_quote_sb.9 | ||
---|---|---|
57–59 | This was based in the verbiage of the comment above the function: * @param src Original buffer. |
share/man/man9/devctl_safe_quote_sb.9 | ||
---|---|---|
57–59 | (arguably, it's not a string anymore if it's not guaranteed to be NUL terminated) How about I just change it to |
share/man/man9/devctl_safe_quote_sb.9 | ||
---|---|---|
57–59 | That WFM. |
share/man/man9/devctl_safe_quote_sb.9 | ||
---|---|---|
52 | I went with roughly this latest version, though I think "[...] escaped." makes more sense to me, since we're not actually further quoting anything but rather escaping existing quotes and escaping previous escapes. |
Manual page LGTM now. I can't vouch for consistency with the source code beyond the one point I raised.