summaryrefslogtreecommitdiff
path: root/src/modules/protocols/protocols.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-05-30 17:06:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-05-30 17:06:14 +0000
commit7fa5563a954339f3feeb156285ef56bfde7cbec8 (patch)
treed7acbc2351a3edf89f0cd35abaab177625c54572 /src/modules/protocols/protocols.cpp
parent91cae4936714bc356a3686daf444d672734da13d (diff)
core fix for Unicode protos
git-svn-id: http://svn.miranda-ng.org/main/trunk@237 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols/protocols.cpp')
-rw-r--r--src/modules/protocols/protocols.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index 02b7c43f23..be423e8017 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -599,24 +599,25 @@ INT_PTR CallProtoServiceInt( HANDLE hContact, const char *szModule, const char *
} } } }
#ifdef _UNICODE
- if ( strcmp( szService, PS_ADDTOLIST ) == 0 ) {
+ if ( !strcmp( szService, PS_ADDTOLIST )) {
PROTOSEARCHRESULT *psr = ( PROTOSEARCHRESULT* )lParam;
- PROTOSEARCHRESULT *psra =( PROTOSEARCHRESULT* )mir_alloc( psr->cbSize );
- memcpy( psra, psr, psr->cbSize );
- psra->nick = ( PROTOCHAR* )mir_u2a( psr->nick );
- psra->firstName = ( PROTOCHAR* )mir_u2a( psr->firstName );
- psra->lastName = ( PROTOCHAR* )mir_u2a( psr->lastName );
- psra->email = ( PROTOCHAR* )mir_u2a( psr->email );
+ if ( !( psr->flags & PSR_UNICODE )) {
+ PROTOSEARCHRESULT *psra =( PROTOSEARCHRESULT* )mir_alloc( psr->cbSize );
+ memcpy( psra, psr, psr->cbSize );
+ psra->nick = ( PROTOCHAR* )mir_u2a( psr->nick );
+ psra->firstName = ( PROTOCHAR* )mir_u2a( psr->firstName );
+ psra->lastName = ( PROTOCHAR* )mir_u2a( psr->lastName );
+ psra->email = ( PROTOCHAR* )mir_u2a( psr->email );
- INT_PTR res = MyCallProtoService( szModule, szService, wParam, ( LPARAM )psra );
+ INT_PTR res = MyCallProtoService( szModule, szService, wParam, ( LPARAM )psra );
- mir_free( psra->nick );
- mir_free( psra->firstName );
- mir_free( psra->lastName );
- mir_free( psra->email );
- mir_free( psra );
-
- return res;
+ mir_free( psra->nick );
+ mir_free( psra->firstName );
+ mir_free( psra->lastName );
+ mir_free( psra->email );
+ mir_free( psra );
+ return res;
+ }
}
#endif