summaryrefslogtreecommitdiffstats
path: root/src/userpref.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-08-04 00:00:32 +0200
committerGravatar Matt Colyer2009-08-04 09:05:06 -0700
commit04dc8e66956ff66f6438fd3ca151d58f528a03ea (patch)
tree41fd587645be4303eeb0e005bc6c90dcd7d26d35 /src/userpref.c
parent12b62b8d2d001e03d8b640afbc44d943d14f24b5 (diff)
downloadlibimobiledevice-04dc8e66956ff66f6438fd3ca151d58f528a03ea.tar.gz
libimobiledevice-04dc8e66956ff66f6438fd3ca151d58f528a03ea.tar.bz2
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 <matt@colyer.name>
Diffstat (limited to 'src/userpref.c')
-rw-r--r--src/userpref.c2
1 files changed, 1 insertions, 1 deletions
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);