comparison src/metadata.c @ 1668:9e168ba1b0b9

fixed an use of uninitialized value
author nadvornik
date Tue, 30 Jun 2009 20:15:33 +0000
parents ece97f3f2305
children 2ec2f6827127
comparison
equal deleted inserted replaced
1667:ece97f3f2305 1668:9e168ba1b0b9
334 334
335 metadata_pathl = path_from_utf8(fd->change->dest); 335 metadata_pathl = path_from_utf8(fd->change->dest);
336 336
337 have_keywords = g_hash_table_lookup_extended(fd->modified_xmp, KEYWORD_KEY, NULL, &keywords); 337 have_keywords = g_hash_table_lookup_extended(fd->modified_xmp, KEYWORD_KEY, NULL, &keywords);
338 have_comment = g_hash_table_lookup_extended(fd->modified_xmp, COMMENT_KEY, NULL, &comment_l); 338 have_comment = g_hash_table_lookup_extended(fd->modified_xmp, COMMENT_KEY, NULL, &comment_l);
339 comment = comment_l ? ((GList *)comment_l)->data : NULL; 339 comment = (have_comment && comment_l) ? ((GList *)comment_l)->data : NULL;
340 340
341 if (!have_keywords || !have_comment) metadata_file_read(metadata_pathl, &orig_keywords, &orig_comment); 341 if (!have_keywords || !have_comment) metadata_file_read(metadata_pathl, &orig_keywords, &orig_comment);
342 342
343 success = metadata_file_write(metadata_pathl, 343 success = metadata_file_write(metadata_pathl,
344 have_keywords ? (GList *)keywords : orig_keywords, 344 have_keywords ? (GList *)keywords : orig_keywords,