[FFmpeg-devel] [PATCH] File concat protocol

Måns Rullgård mans
Sun Jun 24 21:01:54 CEST 2007


Michael Niedermayer <michaelni at gmx.at> writes:

>> +    av_strstart(filename, "cat:", &filename);
>> +
>> +    for (;;) {
>> +        for (len=0; filename[len] && filename[len]!=AV_CAT_SEPARATOR; ++len);

This could use strchr().

>> +        if (len == 0)
>> +            break;
>> +        fn = av_malloc(len+1);
>> +        strncpy(fn, filename, len);
>
> shouldnt av_strlcpy() be used here?

strncpy() certainly won't do the right thing (it rarely does).
av_strlcpy(fn, filename, len+1) should work, even though it's not the
typical use case.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list