about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-07-03 09:15:57 -0400
committerJosh Rickmar <jrick@devio.us>2012-07-03 09:15:57 -0400
commitfd53921a1101cf5bde8d418b99d7dbd135e1025d (patch)
tree6cfbcacf029b4972ed20abaed18fbc1be0bb769f
parent0e45929a64cb8369b3115460f2ebea9eca54c879 (diff)
downloadxombrero-fd53921a1101cf5bde8d418b99d7dbd135e1025d.tar.gz
Prevent the use of an uninitialized variable. My earlier change in
f284a63967c1f5f349abdfbb7b3f8710b6c419fd was wrong due to some
forgotten braces after the if statement.
-rw-r--r--xombrero.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xombrero.c b/xombrero.c
index f5d55bc..ac1a57d 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -787,10 +787,11 @@ guess_url_type(char *url_in)
 			url_out = g_filename_to_uri(url_in, NULL, NULL);
 		else {
 			cwd = malloc(PATH_MAX);
-			if (getcwd(cwd, PATH_MAX) != NULL)
+			if (getcwd(cwd, PATH_MAX) != NULL) {
 				path = g_strdup_printf("%s" PS "%s", cwd,
 				    url_in);
-			url_out = g_filename_to_uri(path, NULL, NULL);
+				url_out = g_filename_to_uri(path, NULL, NULL);
+			}
 			free(cwd);
 			if (path)
 				free(path);