mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 15:38:22 +00:00
Store StrlenDevFd in n (#1056)
This commit is contained in:
parent
e93c8c4f8f
commit
3315b6ef11
1 changed files with 4 additions and 4 deletions
|
@ -180,10 +180,10 @@ static inline void InitProgramExecutableNameImpl(void) {
|
|||
empty string to obviate the TOCTOU problem between loader and binary.
|
||||
*/
|
||||
if (!(b = DevFd()) ||
|
||||
0 != strncmp(b, __program_executable_name, StrlenDevFd()) ||
|
||||
!__program_executable_name[StrlenDevFd()] ||
|
||||
__program_executable_name[StrlenDevFd()] == '.' ||
|
||||
strchr(__program_executable_name + StrlenDevFd(), '/')) {
|
||||
0 != strncmp(b, __program_executable_name, (n = StrlenDevFd())) ||
|
||||
!__program_executable_name[n] ||
|
||||
__program_executable_name[n] == '.' ||
|
||||
strchr(__program_executable_name + n, '/')) {
|
||||
goto UseEmpty;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue