dorimanx / exfat-nofuse

Android ARM Linux non-fuse read/write kernel driver for exFat and VFat Android file systems
GNU General Public License v2.0
709 stars 324 forks source link

exfat_super.c: use strncasecmp instead of strnicmp #60

Closed biergaizi closed 9 years ago

biergaizi commented 9 years ago

There are two functions, strnicmp and strncasecmp do the same thing. In Linux 3.18, strnicmp was renamed to strncasecmp, and the original function became a wrapper to it. In Linux 4.0, strnicmp was removed.

There is a problem, strncasecmp in previous kernels doesn't handle len == 0 properly, and this is the reason of the co-existence of two functions. In my opinion, both alen and blencan't be zero, it should not break the code on previous kernels. So I just simply rename the function call, without check if it is zero to avoid dead code. But I'm not very sure, please verity it.

dorimanx commented 9 years ago

Will this change brake support for older kernel versions? If yes. Make sure to add ifdef as for any other change.

biergaizi commented 9 years ago

If alen and blen can't be zero, it won't. So I'm confirming it now.

dorimanx commented 9 years ago

Good, thanks for update.