Results 1 to 2 of 2

Thread: CL_StringFormat bug (null string)

  1. #1

    Default CL_StringFormat bug (null string)

    Hi, there is a little bug here :
    Code:
    void CL_StringFormat::set_arg(int index, const CL_StringRef &text)
    {
    	if (index >= (int) args.size())
    		return;
    		
    	ArgPosition pos = args[index];
    	if (pos.length == 0)
    		return;
    		
    //...
    if you want to do something like :
    Code:
    CL_StringFormat format("%1%2");
    
    format.set_arg(1, "twiti");
    format.set_arg(2, "");
    //Use result
    format.set_arg(2, "twutu");
    //Use result again
    The second result will be the same as the previous, because we set the string to "". Looks like the problem is with the ArgPositon check.

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    Fixed this bug in 2.3 and 2.4 SVN. Thanks for reporting it.

Similar Threads

  1. How to load a unicode string from xml?
    By Jarett Langton in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 08-10-2011, 11:00 PM
  2. CL_StringFormat::set_arg
    By Melodatron in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 06-13-2011, 09:03 PM
  3. reference to 'string' is ambiguous
    By BigBMan in forum Proton SDK
    Replies: 1
    Last Post: 12-29-2010, 09:52 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •