U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » Problem and fix in HexString
Problem and fix in HexString [message #28551] Mon, 06 September 2010 18:29 Go to previous message
koldo is currently offline  koldo
Messages: 3465
Registered: August 2008
Senior Veteran
Hello Mirek

HexString(const byte *s, int count, int sep, int sepchr) function in file Util.cpp, line 545, does not support count == 0.

In that case, it tries to allocate:
StringBuffer b(2 * count + (count - 1) / sep)

, that is
StringBuffer b(-1)

, so it gives an exception.

Just beginning the function with a
if (count <= 0)
	return "";

would solve it.


Best regards
IƱaki
 
Read Message
Read Message
Previous Topic: VectorMap<String,String> = Seg Fault
Next Topic: Problem and fix in LocalProcess
Goto Forum:
  


Current Time: Fri Dec 04 10:54:05 GMT+1 2026

Total time taken to generate the page: 0.00851 seconds