fdsrc: use g_ascii_strtoull() to convert size string in uri

sscanf() doesn't handle G_GUINT64_FORMAT well on mingw64 it
appears, leading to compiler warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=744034
This commit is contained in:
Frédéric Wang 2015-02-12 14:50:15 +00:00 committed by Tim-Philipp Müller
parent ae0b12b109
commit d7dd082574

View file

@ -645,12 +645,14 @@ gst_fd_src_uri_set_uri (GstURIHandler * handler, const gchar * uri,
}
if ((q = g_strstr_len (uri, -1, "?"))) {
gchar *sp;
gchar *sp, *end = NULL;
GST_INFO_OBJECT (src, "found ?");
if ((sp = g_strstr_len (q, -1, "size="))) {
if (sscanf (sp, "size=%" G_GUINT64_FORMAT, &size) != 1) {
sp += strlen ("size=");
size = g_ascii_strtoull (sp, &end, 10);
if ((size == 0 && errno == EINVAL) || size == G_MAXUINT64 || end == sp) {
GST_INFO_OBJECT (src, "parsing size failed");
size = -1;
} else {