From d47425dac39e16390bc9c5908efc300b011a88ea Mon Sep 17 00:00:00 2001 From: 7 Date: Fri, 27 Oct 2000 15:52:58 +0000 Subject: Return null if no pnode was found. 2000-10-27 * e-pilot-map.c (e_pilot_map_lookup_uid): Return null if no pnode was found. svn path=/trunk/; revision=6229 --- e-util/ChangeLog | 5 +++++ e-util/e-pilot-map.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 3d978fc061..9e369dbdda 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2000-10-27 + + * e-pilot-map.c (e_pilot_map_lookup_uid): Return null if no + pnode was found. + 2000-10-27 JP Rosevear * e-pilot-map.c (map_sax_start_element): Get archive field while diff --git a/e-util/e-pilot-map.c b/e-util/e-pilot-map.c index 583e0ad2ec..4f985ccace 100644 --- a/e-util/e-pilot-map.c +++ b/e-util/e-pilot-map.c @@ -165,7 +165,7 @@ e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean archi guint32 e_pilot_map_lookup_pid (EPilotMap *map, const char *uid) { - EPilotMapUidNode *unode; + EPilotMapUidNode *unode = NULL; unode = g_hash_table_lookup (map->uid_map, uid); @@ -178,10 +178,13 @@ e_pilot_map_lookup_pid (EPilotMap *map, const char *uid) const char * e_pilot_map_lookup_uid (EPilotMap *map, guint32 pid) { - EPilotMapPidNode *pnode; + EPilotMapPidNode *pnode = NULL; pnode = g_hash_table_lookup (map->pid_map, &pid); + if (pnode == NULL) + return NULL; + return pnode->uid; } -- cgit v1.2.3