From 04dc8e66956ff66f6438fd3ca151d58f528a03ea Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 4 Aug 2009 00:00:32 +0200 Subject: Invalid check for host_id in userpref_get_host_id On a system without a previous pairing, libiphone fails to connect to the device: userpref_get_host_id: Using (null) as HostID The code checks if host_id is NULL but it needs to check if *host_id is NULL, otherwise it won't generate a new HostID. [#69 state:resolved] Signed-off-by: Matt Colyer --- src/userpref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/userpref.c b/src/userpref.c index b930693..9dd1a01 100644 --- a/src/userpref.c +++ b/src/userpref.c @@ -148,7 +148,7 @@ void userpref_get_host_id(char **host_id) g_key_file_free(key_file); g_free(config_file); - if (!host_id) { + if (!*host_id) { /* no config, generate host_id */ *host_id = userpref_generate_host_id(); userpref_set_host_id(*host_id); -- cgit v1.1-32-gdbae