From 62aed210b48de5997a03021f879dee5b2b0379aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tanel=20Alum=C3=A4e?= Date: Thu, 4 Jun 2020 10:50:42 +0300 Subject: [PATCH 1/2] Print debug output to stderr in vtt.c Fixes issue #55 --- src/vtt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vtt.c b/src/vtt.c index 23aa10d..5a685f2 100644 --- a/src/vtt.c +++ b/src/vtt.c @@ -161,11 +161,11 @@ void parse_timestamps(const utf8_char_t* line, double* start_pts, double* end_pt *start_pts = -1; *cue_settings = NULL; - printf("Matches: %d\n", matches); + fprintf(stderr, "Matches: %d\n", matches); if (matches >= 1) { *start_pts = parse_timestamp(start_str); - printf("Start pts: %f\n", *start_pts); + fprintf(stderr, "Start pts: %f\n", *start_pts); } if (matches >= 2) { *end_pts = parse_timestamp(end_str); From 5d399d69256b6442da6a2be5cc1e7415876b1913 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Fri, 31 Mar 2023 12:00:50 +0900 Subject: [PATCH 2/2] Fix file pointer leak in utf8_load_text_file --- src/utf8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utf8.c b/src/utf8.c index 7bfb51c..5d0bdb3 100644 --- a/src/utf8.c +++ b/src/utf8.c @@ -217,9 +217,9 @@ utf8_char_t* utf8_load_text_file(const char* path, size_t* size) (*size) += bytes_read; } } - - fclose(file); } + + fclose(file); } data[*size] = 0;