[gtk/matthiasc/for-master: 3/4] Prevent a crash with script names
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 3/4] Prevent a crash with script names
- Date: Mon, 5 Oct 2020 01:37:44 +0000 (UTC)
commit 34f33b36f853930746d38d372ccd4c1384a7636a
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Oct 4 21:20:48 2020 -0400
Prevent a crash with script names
We can't pass NULL to gettext().
demos/gtk-demo/script-names.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/demos/gtk-demo/script-names.c b/demos/gtk-demo/script-names.c
index b9b334d5ee..f378f2530e 100644
--- a/demos/gtk-demo/script-names.c
+++ b/demos/gtk-demo/script-names.c
@@ -193,7 +193,12 @@ get_script_name (GUnicodeScript script)
for (i = 0; i < G_N_ELEMENTS (scripts); i++)
{
if (scripts[i].script == script)
- return g_dpgettext2 (GETTEXT_PACKAGE, "Script", scripts[i].name);
+ {
+ if (scripts[i].name)
+ return g_dpgettext2 (GETTEXT_PACKAGE, "Script", scripts[i].name);
+ else
+ return "";
+ }
}
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]