diff mbox series

[FFmpeg-devel,3/8] avformat/crcenc: Simplify writing trailer

Message ID AM7PR03MB66608DA7BF752E6396F786A18FC49@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit ff02a4239412971b53abde2116e3bc2ce92d58ff
Headers show
Series [FFmpeg-devel,1/8] avformat/vorbiscomment: Don't compute strlen twice | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 23, 2021, 1:16 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/crcenc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Paul B Mahol Aug. 23, 2021, 4:58 p.m. UTC | #1
lgtm
diff mbox series

Patch

diff --git a/libavformat/crcenc.c b/libavformat/crcenc.c
index 4fdc448141..c58fbd6c88 100644
--- a/libavformat/crcenc.c
+++ b/libavformat/crcenc.c
@@ -48,10 +48,8 @@  static int crc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
 static int crc_write_trailer(struct AVFormatContext *s)
 {
     CRCState *crc = s->priv_data;
-    char buf[64];
 
-    snprintf(buf, sizeof(buf), "CRC=0x%08"PRIx32"\n", crc->crcval);
-    avio_write(s->pb, buf, strlen(buf));
+    avio_printf(s->pb, "CRC=0x%08"PRIx32"\n", crc->crcval);
 
     return 0;
 }