[FFmpeg-devel] Re: [PATCH] cmdutils: replace strncpy() with direct assignment

Anton Khirnov anton at khirnov.net
Thu Mar 11 11:07:13 EET 2021


Quoting Gregor Riepl (2021-03-09 18:54:11)
> >      // Change all the ' --' strings to '~--' so that
> >      // they can be identified as tokens.
> >      while ((conflist = strstr(str, " --")) != NULL) {
> > -        strncpy(conflist, "~--", 3);
> > +        conflist[0] = '~';
> >      }
> 
> Doesn't this simply replace -- with ~- ?
> The comment seems wrong to me...

No, it replaces ' --' with '~--', just as the comment says.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list