cvs: php-gtk /ext/gtk+ gtk.overrides
| From: | Frank M. Kromann | Date: | Fri, 04 Jan 2002 20:01:34 +0000 |
| Subject: | cvs: php-gtk /ext/gtk+ gtk.overrides | ||
| Groups: | php.gtk.cvs | ||
| Request: | Send a blank email to php-gtk-cvs+get-430@lists.php.net to get a copy of this message | ||
fmk Fri Jan 4 15:01:34 2002 EDT
Modified files:
/php-gtk/ext/gtk+ gtk.overrides
Log:
Fixing crash when returned texts is null
Index: php-gtk/ext/gtk+/gtk.overrides
diff -u php-gtk/ext/gtk+/gtk.overrides:1.44 php-gtk/ext/gtk+/gtk.overrides:1.45
--- php-gtk/ext/gtk+/gtk.overrides:1.44 Fri Jan 4 12:45:23 2002
+++ php-gtk/ext/gtk+/gtk.overrides Fri Jan 4 15:01:33 2002
@@ -832,8 +832,14 @@
}
#ifdef PHP_WIN32
- cp_text = g_convert(text, strlen(text), GTK_G(codepage), "UTF-8", NULL, NULL, NULL);
- RETURN_STRING(cp_text, 0);
+ if (text) {
+ cp_text = g_convert(text, strlen(text), GTK_G(codepage), "UTF-8", NULL, NULL, NULL);
+ RETURN_STRING(cp_text, 1);
+ g_free(cp_text);
+ }
+ else {
+ RETURN_STRING("", 1);
+ }
#else
RETURN_STRING(text, 1);
#endif
@@ -1456,8 +1462,14 @@
}
#ifdef PHP_WIN32
- cp_text = g_convert(text, strlen(text), GTK_G(codepage), "UTF-8", NULL, NULL, NULL);
- RETURN_STRING(cp_text, 0);
+ if (text) {
+ cp_text = g_convert(text, strlen(text), GTK_G(codepage), "UTF-8", NULL, NULL, NULL);
+ RETURN_STRING(cp_text, 1);
+ g_free(cp_text);
+ }
+ else {
+ RETURN_STRING("", 1);
+ }
#else
RETURN_STRING(text, 1);
#endif