From: Steven Luo Date: Sun, 13 Dec 2009 08:15:41 +0000 (-0800) Subject: Fix thinko in open_address X-Git-Tag: v3.0rc1~26 X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=commitdiff_plain;h=6e58a3c82137f47f41b82a8426a2d6e8be7c39bc Fix thinko in open_address if (!uri && uri[0] = '/') is obviously never going to be true ... Fix by just giving up in the !uri case. Strangely enough, I'm not hitting this in testing on the tablet -- perhaps gcc is optimizing out the test? --- diff --git a/dbus-server-bindings.c b/dbus-server-bindings.c index 3c7718e..b29b1ab 100644 --- a/dbus-server-bindings.c +++ b/dbus-server-bindings.c @@ -47,7 +47,11 @@ static void open_address(const char *uri) { char *new_uri; size_t new_uri_len; - if (!uri && uri[0] == '/') { + if (!uri) + /* Not much to do in this case ... */ + return; + + if (uri[0] == '/') { new_uri_len = strlen("file://") + strlen(uri) + 1; if (!(new_uri = calloc(new_uri_len, sizeof(char)))) exit(1);