Patch providided by Scott Field from Microsoft as part of NUMA optimizations.
}
- version = strdup(VERSION);
- btime = strdup(BUILD_TIME);
- buser = strdup(BUILD_USER);
- bmach = strdup(BUILD_MACHINE);
- fprog = strdup(Program());
+ version = gmx_strdup(VERSION);
+ btime = gmx_strdup(BUILD_TIME);
+ buser = gmx_strdup(BUILD_USER);
+ bmach = gmx_strdup(BUILD_MACHINE);
+ fprog = gmx_strdup(Program());
ftime = &(timebuf[0]);
* a '\0' to end the directory string .
*/
if (i > 0) {
- directory = strdup(file);
+ directory = gmx_strdup(file);
directory[i] = '\0';
- fn = strdup(file+i+1);
+ fn = gmx_strdup(file+i+1);
}
else {
- directory = strdup(".");
- fn = strdup(file);
+ directory = gmx_strdup(".");
+ fn = gmx_strdup(file);
}
do {
sprintf(buf,"%s/#%s.%d#",directory,fn,count);
ret = NULL;
if (bAddCWD && gmx_fexist(file))
{
- ret = strdup(file);
+ ret = gmx_strdup(file);
}
else
{
sprintf(buf,"%s%c%s",dir,DIR_SEPARATOR,file);
if (gmx_fexist(buf))
{
- ret = strdup(buf);
+ ret = gmx_strdup(buf);
}
}
if (ret == NULL && bFatal)
}
else
{
- tmpnm=strdup(lognm);
+ tmpnm=gmx_strdup(lognm);
}
gmx_bcast(len*sizeof(*tmpnm),tmpnm,cr);
}
else
{
- tmpnm=strdup(lognm);
+ tmpnm=gmx_strdup(lognm);
}
debug_gmx();
ftp = fn2ftp(fnm[i].fns[0]);
par_fn(fnm[i].fns[0],ftp,cr,TRUE,FALSE,buf,255);
sfree(fnm[i].fns[0]);
- fnm[i].fns[0] = strdup(buf);
+ fnm[i].fns[0] = gmx_strdup(buf);
}
}
}
stringlen=strlen(string);
if ((string == NULL) || (slen == 0) || (stringlen == 0)) {
if (string)
- buf=strdup(string);
+ buf=gmx_strdup(string);
return buf;
}
rlen=strlen(replace);
stringlen=strlen(string);
if ((string == NULL) || (searchlen == 0) || (stringlen == 0)) {
if (string)
- buf=strdup(string);
+ buf=gmx_strdup(string);
return buf;
}
replacelen=strlen(replace);
/* Copy input to a non-constant char buffer.
* buf1 is allocated here
*/
- buf1=strdup(s);
+ buf1=gmx_strdup(s);
for(i=0; (i<nsr); i++) {
/* Replace in buffer1, put result in buffer2.
/* Copy input to a non-constant char buffer.
* buf1 is allocated here
*/
- buf1=strdup(s);
+ buf1=gmx_strdup(s);
for(i=0; (i<nsr); i++) {
/* Replace in buffer1, put result in buffer2.
snew(links->sr,n);
for(i=0,j=0; (i<n); i++) {
if (!program || (gmx_strcasecmp(program,filestr[i]) != 0)) {
- links->sr[j].search=strdup(filestr[i]);
+ links->sr[j].search=gmx_strdup(filestr[i]);
if (bWiki)
sprintf(buf,"[[%s]]",filestr[i]);
else
sprintf(buf,"<a href=\"%s.html\">%s</a>",filestr[i],filestr[i]);
- links->sr[j].replace=strdup(buf);
+ links->sr[j].replace=gmx_strdup(buf);
j++;
}
}