1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
$NetBSD: patch-aj,v 1.5 2003/09/01 10:17:39 cjep Exp $
--- ext/gettext/gettext.c.orig 2003-08-30 21:56:34.000000000 +0200
+++ ext/gettext/gettext.c 2003-08-30 21:57:13.000000000 +0200
@@ -58,6 +58,11 @@
};
/* }}} */
+#define CHECK(a) if (a == NULL) { \
+ fprintf(stderr, "%s, %d: NULL value\n", __FILE__, __LINE__); \
+ a = ""; \
+}
+
zend_module_entry php_gettext_module_entry = {
STANDARD_MODULE_HEADER,
"gettext",
@@ -104,6 +109,7 @@
retval = textdomain(domain_name);
+ CHECK(retval);
RETURN_STRING(retval, 1);
}
/* }}} */
@@ -141,6 +147,7 @@
msgstr = dgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid));
+ CHECK(msgstr);
RETURN_STRING(msgstr, 1);
}
/* }}} */
@@ -161,6 +168,7 @@
msgstr = dcgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid), Z_LVAL_PP(category));
+ CHECK(msgstr);
RETURN_STRING(msgstr, 1);
}
/* }}} */
@@ -191,6 +199,7 @@
retval = bindtextdomain(Z_STRVAL_PP(domain_name), dir_name);
+ CHECK(retval);
RETURN_STRING(retval, 1);
}
/* }}} */
|