alsaucm: dump - fix the prefixed "

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2019-11-30 20:38:17 +01:00
parent 49716fa61e
commit 160b47e27c

View file

@ -73,9 +73,9 @@ static char *tesc(const char *s, char *buf, size_t buf_len)
buf_len--; buf_len--;
} }
while (*s && buf_len > 2) { while (*s && buf_len > 2) {
if (*s == '\"') { if (*s == '"') {
if (buf_len > 3) { if (buf_len > 3) {
*dst++ = '"'; *dst++ = '\\';
*dst++ = *s++; *dst++ = *s++;
buf_len -= 2; buf_len -= 2;
continue; continue;
@ -240,9 +240,9 @@ static char *jesc(const char *s, char *buf, size_t buf_len)
*dst++ = c; *dst++ = c;
buf_len--; buf_len--;
while (*s && buf_len > 2) { while (*s && buf_len > 2) {
if (*s == '\"') { if (*s == '"') {
if (buf_len > 3) { if (buf_len > 3) {
*dst++ = '"'; *dst++ = '\\';
*dst++ = *s++; *dst++ = *s++;
buf_len -= 2; buf_len -= 2;
continue; continue;