fix for solaris; patch supplied by Douglas E. Engert <deengert@anl.gov>

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2287 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
nils 2005-03-29 19:59:30 +00:00
parent 9e7ca27fda
commit f2526dfd8e
1 changed files with 9 additions and 1 deletions

View File

@ -212,7 +212,15 @@ int main(int argc, char **argv)
}
buff[r] = '\0';
if (exec_program) {
setenv(esteid_data[i].env_name, buff, 1);
char * cp;
cp = malloc(strlen(esteid_data[i].env_name) +
strlen(buff) + 2);
if (cp) {
strcpy(cp,esteid_data[i].env_name);
strcat(cp,"=");
strcat(cp,buff);
putenv(cp);
}
} else {
printf("%s: %s\n", esteid_data[i].name, buff);
}