Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 next message
koldo is currently offline  koldo
Messages: 3358
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
Re: Problem and fix in HexString [message #28557 is a reply to message #28551] Tue, 07 September 2010 05:28 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, good catch.
Previous Topic: VectorMap<String,String> = Seg Fault
Next Topic: Problem and fix in LocalProcess
Goto Forum:
  


Current Time: Mon Apr 29 16:53:28 CEST 2024

Total time taken to generate the page: 0.01883 seconds