mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
strnlen isn't available on some platforms, use StringRef instead
llvm-svn: 224679
This commit is contained in:
parent
d6845c2d5a
commit
45ac06f549
@ -3664,7 +3664,8 @@ static void PrintLinkerOptionCommand(MachO::linker_option_command lo,
|
||||
if (left > 0) {
|
||||
i++;
|
||||
outs() << " string #" << i << " " << format("%.*s\n", left, string);
|
||||
uint32_t len = strnlen(string, left) + 1;
|
||||
uint32_t NullPos = StringRef(string, left).find('\0');
|
||||
uint32_t len = std::min(NullPos, left) + 1;
|
||||
string += len;
|
||||
left -= len;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user