summaryrefslogtreecommitdiff
path: root/base/inifile.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-06-04 14:16:04 -0400
committerNathan Binkert <binkertn@umich.edu>2005-06-04 14:16:04 -0400
commit6b6445eeb92e9ef40e08348691c47aa3153c088d (patch)
treef4869517321bb95c1cbd39b9868e860f5524dd78 /base/inifile.cc
parent372b5e706ce8258cdcf68825901f2d5f2f2ee87e (diff)
downloadgem5-6b6445eeb92e9ef40e08348691c47aa3153c088d.tar.xz
more portable
arch/alpha/alpha_tru64_process.cc: Sort #includes Make code more portable. g++ doesn't seem to always like struct ::stat (and others). So, we typedef stat outside of the namespace as something else and use the typedef base/hostinfo.cc: use snprintf to quell warning base/inifile.cc: use strncpy to quell warning base/stats/events.cc: don't use strcpy cpu/beta_cpu/btb.cc: use FloorLog2 instead of log2 cpu/beta_cpu/comm.hh: cpu/beta_cpu/inst_queue.hh: cpu/beta_cpu/sat_counter.hh: use sim/host.hh instead of stdint.h --HG-- extra : convert_revision : 59bd9235dda74e72a8b6a70b3f3a981840384f3f
Diffstat (limited to 'base/inifile.cc')
-rw-r--r--base/inifile.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/inifile.cc b/base/inifile.cc
index 862e4082f..cbb506c8b 100644
--- a/base/inifile.cc
+++ b/base/inifile.cc
@@ -79,7 +79,8 @@ IniFile::loadCPP(const string &file, vector<char *> &cppArgs)
tmpf.close();
- char *cfile = strcpy(new char[file.size() + 1], file.c_str());
+ char *cfile = strncpy(new char[file.size() + 1], file.c_str(),
+ file.size());
char *dir = dirname(cfile);
char *dir_arg = NULL;
if (*dir != '.') {
@@ -87,7 +88,7 @@ IniFile::loadCPP(const string &file, vector<char *> &cppArgs)
arg += dir;
dir_arg = new char[arg.size() + 1];
- strcpy(dir_arg, arg.c_str());
+ strncpy(dir_arg, arg.c_str(), arg.size());
}
delete [] cfile;