Commit dde80688 authored by Alexander Strasser's avatar Alexander Strasser

ffprobe: Consider the chosen separator when doing CSV escaping

Signed-off-by: 's avatarAlexander Strasser <eclipse7@gmx.net>
parent dd830283
......@@ -567,7 +567,8 @@ static const char *c_escape_str(AVBPrint *dst, const char *src, const char sep,
*/
static const char *csv_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
{
int needs_quoting = !!src[strcspn(src, "\",\n\r")];
char meta_chars[] = { sep, '"', '\n', '\r', '\0' };
int needs_quoting = !!src[strcspn(src, meta_chars)];
if (needs_quoting)
av_bprint_chars(dst, '\"', 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment