From: Frédéric Wang Date: Thu, 12 Feb 2015 14:50:15 +0000 (+0000) Subject: fdsrc: use g_ascii_strtoull() to convert size string in uri X-Git-Tag: 1.6.1~556 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7dd0825747abbbda22e8466dd6ba78fa85c0dbe;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index 82b8344..8058328 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -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 {