diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-28 18:04:38 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-28 18:04:38 +0000 |
commit | 12ea66a7277240c5b045ed14c140f94d453eea0e (patch) | |
tree | 86b0fb053e20cd76aab065b69b25eee033939677 /lib/Target/PIC16/PIC16.h | |
parent | 2c47368a7d843486a59e12a08595297003e3cb2d (diff) |
Replace strcpy with memcpy when we have the length around anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PIC16/PIC16.h')
-rw-r--r-- | lib/Target/PIC16/PIC16.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/PIC16/PIC16.h b/lib/Target/PIC16/PIC16.h index e46c9b242e..8d067de676 100644 --- a/lib/Target/PIC16/PIC16.h +++ b/lib/Target/PIC16/PIC16.h @@ -55,9 +55,10 @@ namespace PIC16CC { // External symbol names require memory to live till the program end. // So we have to allocate it and keep. + // FIXME: Don't leak the allocated strings. inline static const char *createESName (const std::string &name) { char *tmpName = new char[name.size() + 1]; - strcpy (tmpName, name.c_str()); + memcpy(tmpName, name.c_str(), name.size() + 1); return tmpName; } |