Bugfix: MODE SELECT for format page is incorrect (issue #818)#899
Bugfix: MODE SELECT for format page is incorrect (issue #818)#899
Conversation
akuker
left a comment
There was a problem hiding this comment.
Approved @uweseimet . I'll let you do the merging. Thanks!
|
This might not have been caused by the changes in this PR, but I'm getting this compiler error with gcc 10.2.1 / Bullseye / ARM (Pi Zero W). |
|
@akuker Looks as if your suggested change (which I liked better than the previous code) is causing this issue. I will change the code back to using strcpy as part of this PR. I hope that's fine for you. |
|
@rdmark I fixed the compilation issue (which was depending on the compiler used) and double-checked that it compiles again on bullseye. |
|
SonarCloud Quality Gate failed. |
|
@akuker @rdmark I think I know now how to make the compiler happy while still using strncpy: Actually the compiler is right: If you copy exactly IFNAMSIZ bytes the terminating null byte for the string will be missing. |








Successfully tested with software that can change the sector size before formatting. Unit tests were added for the updated code.
After fixing the descriptor and offset handling rascsi behaves like a Fujitsu M2624S drive and a MODE SELECT/FORMAT sequence works as far as rascsi can support it.