Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG in SBCSGroupProber class in function Reset #4

Open
GoogleCodeExporter opened this issue Mar 17, 2015 · 1 comment
Open

BUG in SBCSGroupProber class in function Reset #4

GoogleCodeExporter opened this issue Mar 17, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

http://ude.googlecode.com/svn/trunk/src/Library/Ude.Core/SBCSGroupProber.cs

existing code:

public override void Reset ()
{
    int activeNum = 0;
...

SHOULD be:

public override void Reset ()
{
    activeNum = 0;
...

in many cases this bug will cause fail to detect right charset because class 
member activeNum is currently always 0 because in Reset function local variable 
used, see this piece of code:
} else if (st == ProbingState.NotMe) {
   isActive[i] = false;
   activeNum--;
   if (activeNum <= 0) {
      state = ProbingState.NotMe;
      break;
   }
}

I fixed it locally but want that other developer didn't spent much time 
debugging the same issue)

attached file is where bug is reproduced (charset is KOI8-R)

Original issue reported on code.google.com by [email protected] on 25 May 2012 at 6:40

Attachments:

@GoogleCodeExporter
Copy link
Author

a simple workaround would be not to use the Reset() method and simply construct 
a new instance of the class.

Original comment by [email protected] on 22 Dec 2014 at 10:29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant