Remove devctl_safe_quote since it's now unused.
Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D16026
This commit is contained in:
parent
d21a52ae1b
commit
bc6cb3f6b4
@ -851,38 +851,6 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief safely quotes strings that might have double quotes in them.
|
||||
*
|
||||
* The devctl protocol relies on quoted strings having matching quotes.
|
||||
* This routine quotes any internal quotes so the resulting string
|
||||
* is safe to pass to snprintf to construct, for example pnp info strings.
|
||||
* Strings are always terminated with a NUL, but may be truncated if longer
|
||||
* than @p len bytes after quotes.
|
||||
*
|
||||
* @param dst Buffer to hold the string. Must be at least @p len bytes long
|
||||
* @param src Original buffer.
|
||||
* @param len Length of buffer pointed to by @dst, including trailing NUL
|
||||
*/
|
||||
void
|
||||
devctl_safe_quote(char *dst, const char *src, size_t len)
|
||||
{
|
||||
char *walker = dst, *ep = dst + len - 1;
|
||||
|
||||
if (len == 0)
|
||||
return;
|
||||
while (src != NULL && walker < ep)
|
||||
{
|
||||
if (*src == '"' || *src == '\\') {
|
||||
if (ep - walker < 2)
|
||||
break;
|
||||
*walker++ = '\\';
|
||||
}
|
||||
*walker++ = *src++;
|
||||
}
|
||||
*walker = '\0';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief safely quotes strings that might have double quotes in them.
|
||||
*
|
||||
|
@ -156,7 +156,6 @@ void devctl_notify(const char *__system, const char *__subsystem,
|
||||
const char *__type, const char *__data);
|
||||
void devctl_queue_data_f(char *__data, int __flags);
|
||||
void devctl_queue_data(char *__data);
|
||||
void devctl_safe_quote(char *__dst, const char *__src, size_t __len);
|
||||
struct sbuf;
|
||||
void devctl_safe_quote_sb(struct sbuf *__sb, const char *__src);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user