Projects > cpp > Issues > Bug #2761

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github : divideStringWithMaxWidth method index out of range

Bug #2761 [Closed]
linguohua 2013-09-02 07:25 . Updated about 5 years ago

/* Break a String into String[] by the width & should wrap the word. */
for (int i = 1; i <= charLength; ++i) {

>should change to:
for (int i = 1; i < charLength; ++i) {

we call CCLabelTTF::setString method will crash, when the CCLabelTTF control’s
width and it’s content meet some conditions.

zhangxm 2013-09-26 14:58
  • Status changed from New to Closed
  • Assignee changed from to zhangxm
  • % Done changed from 0 to 100

Atom PDF

Start date:2013-09-02
Due date:
% Done:


Category:all, android
Target version:2.2

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.