From 82ee11f5fc5be88baad3e3c7b626b078bda5d915 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Sat, 12 Mar 2011 19:52:35 +0100
Subject: Avoid warning on end of file in cache files.


diff --git a/Swiften/Avatars/AvatarFileStorage.cpp b/Swiften/Avatars/AvatarFileStorage.cpp
index 62dfdf6..4f76c80 100644
--- a/Swiften/Avatars/AvatarFileStorage.cpp
+++ b/Swiften/Avatars/AvatarFileStorage.cpp
@@ -29,8 +29,8 @@ AvatarFileStorage::AvatarFileStorage(const boost::filesystem::path& avatarsDir,
 					if (jid.isValid()) {
 						jidAvatars.insert(std::make_pair(jid, r.first));
 					}
-					else {
-						std::cerr << "Invalid entry in avatars file" << std::endl;
+					else if (!r.first.empty() || !r.second.empty()) {
+						std::cerr << "Invalid entry in avatars file: " << r.second << std::endl;
 					}
 				}
 			}
diff --git a/Swiften/VCards/VCardFileStorage.cpp b/Swiften/VCards/VCardFileStorage.cpp
index db189ff..a246838 100644
--- a/Swiften/VCards/VCardFileStorage.cpp
+++ b/Swiften/VCards/VCardFileStorage.cpp
@@ -35,7 +35,7 @@ VCardFileStorage::VCardFileStorage(boost::filesystem::path dir) : vcardsPath(dir
 					if (jid.isValid()) {
 						photoHashes.insert(std::make_pair(jid, r.first));
 					}
-					else {
+					else if (!r.first.empty() || !r.second.empty()) {
 						std::cerr << "Invalid entry in phashes file" << std::endl;
 					}
 				}
-- 
cgit v0.10.2-6-g49f6