-
Notifications
You must be signed in to change notification settings - Fork 454
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
fix(DiskIO): fix readlink #664
Conversation
You fix what? |
equals to char pathSysDeviceReal[PATH_MAX];
pathSysDeviceReal = 0; and the manpages said:
So, if readlink success, we got a invalid Null-terminated string. |
Or, if use this:
It will zero-filled by memset or other functions. Since PATH_MAX on some Linux distros are set to 4096, it could be a noticeable cost. |
This since C11, this project using C11, so, it will be zero-filled, and in most cases it's unnecessary. |
Citation needed |
And even if you want to "fix" this, the same code in physical_linux.c (committed today) should be fixed too. |
5b0673a
to
ef220e8
Compare
Please be cautious when using words like "bug" and "fix" |
It's my miss, C99 said the same thing at 6.7.8-21, some old unix's CCs confuse me with their implement behaviors. |
Thank u, I see. |
No description provided.