summaryrefslogtreecommitdiff
path: root/gstrfuncs.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-09-10 16:04:33 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-09-10 16:04:33 +0000
commit333f4c43256867b9cba26950727ce7a03af4e90f (patch)
tree5b50c422917a1f313de4de6ae7f07d551940c58c /gstrfuncs.c
parent25c1ae6c1123bdb55cad1b7a450c83db0d1b0554 (diff)
downloadglib-333f4c43256867b9cba26950727ce7a03af4e90f.tar.gz
Add a missing g_return_if_fail().
Sat Sep 9 18:50:42 2000 Owen Taylor <otaylor@redhat.com> * gstrfuncs.c (g_strescape): Add a missing g_return_if_fail().
Diffstat (limited to 'gstrfuncs.c')
-rw-r--r--gstrfuncs.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gstrfuncs.c b/gstrfuncs.c
index 2a0a31d47..21dc2597b 100644
--- a/gstrfuncs.c
+++ b/gstrfuncs.c
@@ -1152,11 +1152,16 @@ gchar *
g_strescape (const gchar *source,
const gchar *exceptions)
{
- const guchar *p = (guchar *) source;
- /* Each source byte needs maximally four destination chars (\777) */
- gchar *dest = g_malloc (strlen (source) * 4 + 1);
- gchar *q = dest;
+ const guchar *p;
+ gchar *dest;
+ gchar *q;
guchar excmap[256];
+
+ g_return_val_if_fail (source != NULL, NULL);
+
+ p = (guchar *) source;
+ /* Each source byte needs maximally four destination chars (\777) */
+ q = dest = g_malloc (strlen (source) * 4 + 1);
memset (excmap, 0, 256);
if (exceptions)