Official eMule-Board: Errorneous "search Details" Button Text - Official eMule-Board

Jump to content


Page 1 of 1

Errorneous "search Details" Button Text

#1 User is offline   fox88 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4974
  • Joined: 13-May 07

Posted 26 July 2015 - 11:37 AM

Button text on Kad tab displays random characters (often Chinese) instead of current search term.

How to see the bug (I used the official beta build).
Make sure KAD is connected, click Contacts(...) button in KAD tab to switch to Search Details(...) mode.
If there is any search with non-empty Name, click on it and look at the button text.
Otherwise start search for any word - "documentary" for example, return to KAD tab and select corresponding line in Current Searches list.

The reason is that formatter interprets code %s as pointer to a character string.
But GetGUIName() has type CKadTagValueString&, and it must be cast to char*/string/CString.

PS. There are other places in code potentially with the same trouble, but that one was most evident.

One simple solution could be to rewrite the method GetCurrentLookupTitle() as below:
CString CKadLookupGraph::GetCurrentLookupTitle() const
{
	if (m_pLookupHistory == NULL)
		return _T("");
	if (!m_pLookupHistory->GetGUIName().IsEmpty())
		return _T('\"') + m_pLookupHistory->GetGUIName() + _T('\"');
	return m_pLookupHistory->GetTypeName();
}

This post has been edited by fox88: 26 July 2015 - 11:38 AM

0

#2 User is offline   fox88 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4974
  • Joined: 13-May 07

Posted 26 July 2015 - 05:21 PM

Here is the list of problems related to analyzer diagnostics:
The 'Format' function is not expected to receive class-type variable as ... actual argument.
Necessary changes are given below line numbers/file names

Line 445, file srchybrid\abstractfile.cpp
Use %I64u and (uint64)GetFileSize(), correspondingly.

Line 1059, file srchybrid\emule.cpp
Use %I64u and (uint64)f->GetFileSize(), correspondingly.

Line 1023, file srchybrid\kademlia\net\kademliaudplistener.cpp
s_pstrDbgSearchExpr->AppendFormat(_T(" \"%ls\""), (CString&)str);

Line 1053, file srchybrid\kademlia\net\kademliaudplistener.cpp
s_pstrDbgSearchExpr->AppendFormat(_T(" Tag%02X=\"%ls\""), (BYTE)strTagName[0], (CString&)strValue);

Line 1055, file srchybrid\kademlia\net\kademliaudplistener.cpp
s_pstrDbgSearchExpr->AppendFormat(_T(" \"%s\"=\"%ls\""), strTagName, (CString&)strValue);

Line 1291, file srchybrid\kademlia\net\kademliaudplistener.cpp
sInfo.AppendFormat(_T(" Name=\"%ls\""), (CString&)pEntry->GetCommonFileName());

Line 633, file srchybrid\kadlookupgraph.cpp
-- already covered above --

Line 1114, file srchybrid\otherfunctions.cpp
temp.Format(_T("%I64u"), (uint64)file->GetFileSize());

Line 314, file srchybrid\kademlia\kademlia\search.cpp
DEBUG_ONLY( DebugLogWarning(_T("Best KADEMLIA_FIND_VALUE nodes for LookUp (%s) were unreachable or dead, reasking closest for more"), (CString&)GetGUIName()) );

Line 843, file srchybrid\udpsocket.cpp
DebugLogWarning(_T("Error: Server UDP socket: Failed to resolve address for '%hs' - %s"), (CString&)pszHostAddressA, GetErrorMessage(GetLastError(), 1));

This post has been edited by fox88: 26 July 2015 - 05:22 PM

0

#3 User is offline   xilolee 

  • eMule 0.50b BETA1 user
  • PipPipPipPipPipPipPip
  • Group: Italian Moderators
  • Posts: 7983
  • Joined: 20-August 08

Posted 27 July 2015 - 02:22 PM

Hi fox88.
Is this one the same of Kad Toolbar's Main Button Shrinks - emule 0.50a?
INCONCEIVABLE! - You keep using that word. I do not think it means what you think it means.
come ottenere aiuto italian guides - guide della sezione italiana
italian support - sezione italiana scaricare la lista server
ottenere id alto impostare le porte nel router
recuperare file corrotti i filtri ip
Sembra talco ma non č serve a darti l'allegrIa! Se lo lanci e poi lo respiri ti dā subito l'allegrIa! Posted Image
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users