diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-02-05 19:50:20 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-02-05 19:50:20 +0000 |
commit | 96d3720a8b42bdd4e2595b57a725930289dc791f (patch) | |
tree | 6ce9a54ca612851fe772c54b7c82aadfc4d4fa11 /plugins/Non-IM Contact/src/contactinfo.cpp | |
parent | 9266f20959d58859070111cafe2a054de906fbb0 (diff) |
Various:
-some warnings fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@12011 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Non-IM Contact/src/contactinfo.cpp')
-rw-r--r-- | plugins/Non-IM Contact/src/contactinfo.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index a14a5da846..9bc7750229 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -331,7 +331,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) string = newString[k];
j=0;
}
- else if (!strncmp(&replace[i], "\r\n",2)) {
+ else if (!strncmp(replace + i, "\r\n",2)) {
if (string == newString[k])
k--;
if (k == MAX_REPLACES) break;
@@ -344,7 +344,8 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) string[++j] = '\0';
}
i++;
- }
+ }
+ free(replace);
hContact2 =(MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact2,(LPARAM)MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE);
@@ -616,10 +617,15 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam) mir_snprintf(tmp, SIZEOF(tmp), "Icon: On The Phone\r\n");
else if (icon == ID_STATUS_OUTTOLUNCH)
mir_snprintf(tmp, SIZEOF(tmp), "Icon: Out To Lunch\r\n");
- else
+ else {
+ free(msg);
continue;
- msg = (char*)realloc(msg, strlen(msg) + strlen(tmp) +1);
- strcat(msg,tmp);
+ }
+ char *msgtemp = (char*)realloc(msg, strlen(msg) + strlen(tmp) +1);
+ if (msgtemp) {
+ msg = msgtemp;
+ strcat(msg,tmp);
+ }
}
if (usetimer && timer) {
char tmp[64],tmp2[8];
@@ -627,8 +633,11 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam) strcpy(tmp2,"Minutes");
else strcpy(tmp2,"Seconds");
mir_snprintf(tmp, SIZEOF(tmp), "UseTimer: Yes\r\nTimer: %d %s",timer, tmp2);
- msg = (char*)realloc(msg, strlen(msg) + strlen(tmp) +1);
- strcat(msg,tmp);
+ char *msgtemp = (char*)realloc(msg, strlen(msg) + strlen(tmp) +1);
+ if (msgtemp) {
+ msg = msgtemp;
+ strcat(msg,tmp);
+ }
}
if (MessageBoxA(0,msg,modFullname,MB_YESNO) == IDYES) {
|