perl-Glib r1064 - trunk



Author: tsch
Date: Mon Feb  2 20:15:50 2009
New Revision: 1064
URL: http://svn.gnome.org/viewvc/perl-Glib?rev=1064&view=rev

Log:
Fix the actual compiler warning, this time.


Modified:
   trunk/Glib.xs

Modified: trunk/Glib.xs
==============================================================================
--- trunk/Glib.xs	(original)
+++ trunk/Glib.xs	Mon Feb  2 20:15:50 2009
@@ -100,19 +100,18 @@
         dTHR;
 
         GError *error = NULL;
-        gchar *lname;
-        STRLEN len;
-        gchar *filename = SvPVutf8 (sv, len);
-
-	/* look out: len is the length of the input when we call, but
-	 * will be the length of the output when this call finishes. */
-        lname = g_filename_from_utf8 ((const gchar *) filename,
-                                      len, 0, &len, &error);
+        gchar *lname = NULL;
+        gsize output_length = 0;
+        STRLEN input_length = 0;
+        gchar *filename = SvPVutf8 (sv, input_length);
+
+        lname = g_filename_from_utf8 (filename, input_length,
+                                      0, &output_length, &error);
         if (!lname)
         	gperl_croak_gerror (NULL, error);
 
-        filename = gperl_alloc_temp (len + 1);
-        memcpy (filename, lname, len);
+        filename = gperl_alloc_temp (output_length + 1);
+        memcpy (filename, lname, output_length);
         g_free (lname);
 
         return filename;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]