summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-06-19 18:56:43 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-06-19 18:56:43 +0000
commita0827f61f16f691962b378ab64ea27e5132dc506 (patch)
tree4ffa8a3c69d9a698a10c9a499339b8cf293d8b88
parentd0dca507c9fc51b566e73fac8c2827daaed441b1 (diff)
GG:
- Minor fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@14268 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp14
-rw-r--r--protocols/Gadu-Gadu/src/dynstuff.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp3
3 files changed, 10 insertions, 13 deletions
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index aecff512e9..a142393008 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -727,12 +727,13 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
case PSN_INFOCHANGED:
{
- char *szProto;
MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam;
GGPROTO *gg = dat->gg;
+ if (!dat)
+ break;
// Show updated message
- if (dat && dat->updating)
+ if (dat->updating)
{
MessageBox(NULL, TranslateT("Your details has been uploaded to the public directory."),
gg->m_tszUserName, MB_OK | MB_ICONINFORMATION);
@@ -740,15 +741,12 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
}
- if (hContact == NULL)
- szProto = gg->m_szModuleName;
- else
- szProto = GetContactProto(hContact);
+ char *szProto = (hContact == NULL) ? gg->m_szModuleName : GetContactProto(hContact);
if (szProto == NULL)
break;
// Disable when updating
- if (dat) dat->disableUpdate = TRUE;
+ dat->disableUpdate = TRUE;
SetValue(hwndDlg, IDC_UIN, hContact, szProto, GG_KEY_UIN, 0, hContact != NULL);
SetValue(hwndDlg, IDC_REALIP, hContact, szProto, GG_KEY_CLIENTIP, SVS_IP, hContact != NULL);
@@ -780,7 +778,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
}
// Disable when updating
- if (dat) dat->disableUpdate = FALSE;
+ dat->disableUpdate = FALSE;
break;
}
}
diff --git a/protocols/Gadu-Gadu/src/dynstuff.cpp b/protocols/Gadu-Gadu/src/dynstuff.cpp
index 4d21ed7eb0..9c9656da84 100644
--- a/protocols/Gadu-Gadu/src/dynstuff.cpp
+++ b/protocols/Gadu-Gadu/src/dynstuff.cpp
@@ -549,13 +549,11 @@ void array_add(char ***array, char *string)
*/
char *array_join(char **array, const char *sep)
{
- string_t s = string_init(NULL);
- int i;
-
if (!array)
return _strdup("");
- for (i = 0; array[i]; i++) {
+ string_t s = string_init(NULL);
+ for (int i = 0; array[i]; i++) {
if (i)
string_append(s, sep);
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp
index 6922b85c2c..3c17b89cee 100644
--- a/protocols/Gadu-Gadu/src/import.cpp
+++ b/protocols/Gadu-Gadu/src/import.cpp
@@ -393,7 +393,8 @@ INT_PTR GGPROTO::import_text(WPARAM wParam, LPARAM lParam)
mir_sntprintf(error, TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLog(_T("import_text(): Cannot import list from file \"%s\". errno=%d: %s"), str, errno, strerror(errno));
- fclose(f);
+ if (f)
+ fclose(f);
return 0;
}
}