perl-Glib r1064 - trunk
- From: tsch svn gnome org
- To: svn-commits-list gnome org
- Subject: perl-Glib r1064 - trunk
- Date: Mon, 2 Feb 2009 20:15:50 +0000 (UTC)
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]