Commit ac112717 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Jean-Baptiste Kempf

snapshot: fix format string portability

We cannot assume that timeval.tv_usec (i.e. suseconds_t) is long.
Reported-by: default avatarIan Chamberlain <ian.h.chamberlain@gmail.com>
(cherry picked from commit ab8b6a88654fbe8c0b0664678c07a8191de16bac)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9944e6a7
......@@ -190,9 +190,9 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
&curtime) == 0)
strcpy(buffer, "error");
if (asprintf(&filename, "%s" DIR_SEP "%s%s%03lu.%s",
cfg->path, prefix, buffer, tv.tv_usec / 1000,
cfg->format) < 0)
if (asprintf(&filename, "%s" DIR_SEP "%s%s%03u.%s",
cfg->path, prefix, buffer,
(unsigned)tv.tv_usec / 1000, cfg->format) < 0)
filename = NULL;
}
free(prefix);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment