On Thu, Feb 17, 2022 at 2:57 PM Tomas Härdin <tjop...@acc.umu.se> wrote:
> > + IPFSGatewayContext *c = h->priv_data; > > + char ipfs_full_data_folder[PATH_MAX]; > > + char ipfs_gateway_file[PATH_MAX]; > > + struct stat st; > > + int stat_ret = 0; > > + int ret = AVERROR(EINVAL); > > + FILE *gateway_file = NULL; > > + > > + // Set the first character of c->gateway_buffer to 0. > > + c->gateway_buffer[0] = '\0'; > > unnecessary > Hmm, interesting. I tried to be secure and not let any potential strlen trip when there is garbage data in c->gateway_buffer. Just to set it in a function that always overwrites it anyhow ;) Aka, useless. > > > + > > + // Test $IPFS_GATEWAY. > > + if (getenv("IPFS_GATEWAY") != NULL) { > > + if (snprintf(c->gateway_buffer, sizeof(c->gateway_buffer), > > "%s", > > + getenv("IPFS_GATEWAY")) >= sizeof(c- > > >gateway_buffer)) { > > + av_log(h, AV_LOG_ERROR, "The IPFS_GATEWAY environment > > variable exceeds the maximum length. We allow a max of %li > > characters\n", sizeof(c->gateway_buffer)); > > nit: seems a bit weird to break the if but not the av_log() > Also this should be %zu not %li > The compiler doesn't complain about this one. How do you know %zu is right? I used this table and it knows nothing about %z... https://www.cplusplus.com/reference/cstdio/printf/ Anyhow, I'm certainly not doubting you so changing it (and all other %li occurrences). Other sites seem to indicate it's for printing size_t . So.. erm... the next version can finally be merged? > /Tomas > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".