summaryrefslogtreecommitdiff
path: root/protocols/Facebook/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Facebook/src')
-rw-r--r--protocols/Facebook/src/avatars.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/protocols/Facebook/src/avatars.cpp b/protocols/Facebook/src/avatars.cpp
index 1823c8da4d..76754bbefc 100644
--- a/protocols/Facebook/src/avatars.cpp
+++ b/protocols/Facebook/src/avatars.cpp
@@ -71,11 +71,8 @@ void __cdecl FacebookProto::AvatarsUpdate(void *)
bool bSuccess = false;
if (pReply->resultCode == 200 && pReply->pData && pReply->dataLength) {
- for (int i = 0; i < pReply->headersCount; i++)
- if (!mir_strcmp(pReply->headers[i].szName, "Content-Type")) {
- ai.format = ProtoGetAvatarFormatByMimeType(pReply->headers[i].szValue);
- break;
- }
+ if (auto *pszHdr = Netlib_GetHeader(pReply, "Content-Type"))
+ ai.format = ProtoGetAvatarFormatByMimeType(pszHdr);
if (ai.format != PA_FORMAT_UNKNOWN) {
FILE *fout = _wfopen(ai.filename, L"wb");