mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-04 13:32:29 +00:00
preset: use guint for the version number parts
Use unsigned integers for extra safety (like we do in plugin version parsing).
This commit is contained in:
parent
f9a4dcd074
commit
75ba14c79b
1 changed files with 3 additions and 2 deletions
|
@ -255,12 +255,13 @@ wrong_name:
|
||||||
static guint64
|
static guint64
|
||||||
preset_parse_version (const gchar * str_version)
|
preset_parse_version (const gchar * str_version)
|
||||||
{
|
{
|
||||||
gint major, minor, micro, nano, num;
|
guint major, minor, micro, nano;
|
||||||
|
gint num;
|
||||||
|
|
||||||
major = minor = micro = nano = 0;
|
major = minor = micro = nano = 0;
|
||||||
|
|
||||||
/* parse version (e.g. 0.10.15.1) to guint64 */
|
/* parse version (e.g. 0.10.15.1) to guint64 */
|
||||||
num = sscanf (str_version, "%d.%d.%d.%d", &major, &minor, µ, &nano);
|
num = sscanf (str_version, "%u.%u.%u.%u", &major, &minor, µ, &nano);
|
||||||
/* make sure we have atleast "major.minor" */
|
/* make sure we have atleast "major.minor" */
|
||||||
if (num > 1) {
|
if (num > 1) {
|
||||||
guint64 version;
|
guint64 version;
|
||||||
|
|
Loading…
Reference in a new issue