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

some problems in wss-v2.c #4

Open
Caiyujie007 opened this issue Jan 9, 2020 · 0 comments
Open

some problems in wss-v2.c #4

Caiyujie007 opened this issue Jan 9, 2020 · 0 comments

Comments

@Caiyujie007
Copy link

In function 'int loadidlemap()' , there are code:
unsigned long long *p;
while ((len = read(idlefd, p, IDLEMAP_CHUNK_SIZE)) > 0) {
p += IDLEMAP_CHUNK_SIZE;
g_idlebufsize += len;
}

I think the code should be 'p += 1' other than 'p += IDLEMAP_CHUNK_SIZE', because the datatype of p is unsigned long long. 'p += 1' means add point *p by 8 bytes.

Also, I think 'idlemapp = (pfn / 64) * BITMAP_CHUNK_SIZE;' at line 146 should be 'idlemapp = (pfn / 64)' because of the datetype of g_idlebuf is also 'unsigned long long'.

And 'g_idlebufsize += len;' at line 249 should be 'g_idlebufsize += 1;' for the same reason.

I modified the code and they works well.

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

No branches or pull requests

1 participant