mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-05 18:05:16 +00:00
Print the path with the shortest absolute length, rather than
arbitrarily selecting one. PR: bin/14361 Approved by: wosch MFC after: 1 week
This commit is contained in:
parent
ebc7a029f4
commit
8080703a26
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87759
@ -241,7 +241,8 @@ getwm(p)
|
||||
if (i > MAXPATHLEN || i < -(MAXPATHLEN)) {
|
||||
i = ntohl(i);
|
||||
if (i > MAXPATHLEN || i < -(MAXPATHLEN))
|
||||
errx(1, "integer out of +-MAXPATHLEN (%d): %d", MAXPATHLEN, i);
|
||||
errx(1, "integer out of +-MAXPATHLEN (%d): %d",
|
||||
MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
|
||||
}
|
||||
return(i);
|
||||
}
|
||||
@ -265,7 +266,9 @@ getwf(fp)
|
||||
if (word > MAXPATHLEN || word < -(MAXPATHLEN)) {
|
||||
word = ntohl(word);
|
||||
if (word > MAXPATHLEN || word < -(MAXPATHLEN))
|
||||
errx(1, "integer out of +-MAXPATHLEN (%d): %d", MAXPATHLEN, word);
|
||||
errx(1, "integer out of +-MAXPATHLEN (%d): %d",
|
||||
MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
|
||||
htonl(word));
|
||||
}
|
||||
return(word);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user