aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2009-07-08 21:45:07 -0600
committerGravatar Brendan Taylor <whateley@gmail.com>2009-07-08 21:45:07 -0600
commitf77af67457a2a9ceb5e49b796ef339bd0afbdd77 (patch)
tree5b65dea98f9567fca218384f542672bab371c842 /uzbl.c
parentf60b8c882034190252cc465c33606ccc9ae79a74 (diff)
expand: append "" for a NULL string var
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/uzbl.c b/uzbl.c
index 2751cb6..6b01a32 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -290,7 +290,7 @@ expand(char *s, guint recurse, gboolean escape_markup) {
if(etype == EXP_SIMPLE_VAR ||
etype == EXP_BRACED_VAR) {
if( (c = g_hash_table_lookup(uzbl.comm.proto_var, ret)) ) {
- if(c->type == TYPE_STR) {
+ if(c->type == TYPE_STR && *c->ptr != NULL) {
if(escape_markup) {
char *b = g_markup_escape_text((gchar *)*c->ptr,
strlen((gchar *)*c->ptr));
@@ -299,7 +299,7 @@ expand(char *s, guint recurse, gboolean escape_markup) {
} else {
g_string_append(buf, (gchar *)*c->ptr);
}
- } else if(c && c->type == TYPE_INT) {
+ } else if(c->type == TYPE_INT) {
char *b = itos((uintptr_t)*c->ptr);
g_string_append(buf, b);
g_free(b);