changeset 3805:d8a6432c76f3 libavformat

use strlen and do not write useless trailing 0 according to specs
author bcoudurier
date Sat, 30 Aug 2008 22:24:19 +0000
parents 9a7f26d3b75c
children fa043e93fc66
files mxfenc.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mxfenc.c	Sat Aug 30 22:23:11 2008 +0000
+++ b/mxfenc.c	Sat Aug 30 22:24:19 2008 +0000
@@ -329,7 +329,7 @@
  */
 static void mxf_write_utf16(ByteIOContext *pb, const char *value)
 {
-    int i, size = strlen(value)+1;
+    int i, size = strlen(value);
     for (i = 0; i < size; i++)
         put_be16(pb, value[i]);
 }
@@ -341,12 +341,12 @@
 
     mxf_write_metadata_key(pb, 0x013000);
     PRINT_KEY(s, "identification key", pb->buf_ptr - 16);
-    company_name_len = sizeof("FFmpeg") * 2;
-    product_name_len = sizeof("OP1a Muxer") * 2;
+    company_name_len = strlen("FFmpeg") * 2;
+    product_name_len = strlen("OP1a Muxer") * 2;
 
     length = 80 + company_name_len + product_name_len;
     if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
-        version_string_len = sizeof(LIBAVFORMAT_IDENT) * 2;
+        version_string_len = strlen(LIBAVFORMAT_IDENT) * 2;
         length += 4 + version_string_len;
     }
     klv_encode_ber_length(pb, length);