summaryrefslogtreecommitdiff
path: root/ffprobe.c
diff options
context:
space:
mode:
authorAlexander Strasser <eclipse7@gmx.net>2012-09-17 01:51:53 +0200
committerAlexander Strasser <eclipse7@gmx.net>2012-09-25 01:32:34 +0200
commitdde8068856c19df4c6f5c75522cff2abeb9362b1 (patch)
tree427e1bd27979918caadec885a1375a084f2f9be0 /ffprobe.c
parentdd83028374ea489f34d87bc6fa7547c644309d24 (diff)
ffprobe: Consider the chosen separator when doing CSV escaping
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
Diffstat (limited to 'ffprobe.c')
-rw-r--r--ffprobe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ffprobe.c b/ffprobe.c
index ad94995169..367b3cab8c 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -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);