summaryrefslogtreecommitdiffstats
path: root/lib/Target/PIC16/PIC16.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/PIC16/PIC16.h')
-rw-r--r--lib/Target/PIC16/PIC16.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/PIC16/PIC16.h b/lib/Target/PIC16/PIC16.h
index e46c9b2..8d067de 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;
}
OpenPOWER on IntegriCloud