mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-30 23:33:57 +00:00
eliminate a use of strtoul.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82382 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
67c6b6ee71
commit
d9221d75f0
@ -260,18 +260,8 @@ std::string MCSectionMachO::ParseSectionSpecifier(StringRef Spec, // In.
|
||||
StringRef StubSizeStr = Comma.second;
|
||||
StripSpaces(StubSizeStr);
|
||||
|
||||
// Convert the a null terminated buffer for strtoul.
|
||||
char TmpBuffer[32];
|
||||
if (StubSizeStr.size() >= 32)
|
||||
return"mach-o section specifier has a stub size specifier that is too long";
|
||||
|
||||
memcpy(TmpBuffer, StubSizeStr.data(), StubSizeStr.size());
|
||||
TmpBuffer[StubSizeStr.size()] = 0;
|
||||
|
||||
char *EndPtr;
|
||||
StubSize = strtoul(TmpBuffer, &EndPtr, 0);
|
||||
|
||||
if (EndPtr[0] != 0)
|
||||
// Convert the stub size from a string to an integer.
|
||||
if (StubSizeStr.getAsInteger(0, StubSize))
|
||||
return "mach-o section specifier has a malformed stub size";
|
||||
|
||||
return "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user