eliminate a use of strtoul.

llvm-svn: 82382
This commit is contained in:
Chris Lattner 2009-09-20 06:58:54 +00:00
parent 17ec6b11d2
commit a15f0044a0
1 changed files with 2 additions and 12 deletions

View File

@ -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 "";