From 203205849e5fa6e6196d120e57803b5171892dd7 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 11 Mar 2011 15:53:09 +0000 Subject: [PATCH] Fix bug with certificate approval --- direct/src/plugin/p3dCert.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/direct/src/plugin/p3dCert.cxx b/direct/src/plugin/p3dCert.cxx index 1b374a273d..0d48bbc107 100644 --- a/direct/src/plugin/p3dCert.cxx +++ b/direct/src/plugin/p3dCert.cxx @@ -203,7 +203,6 @@ approve_cert() { #endif // Look for an unused filename. - string pathname; int i = 1; char buf [PATH_MAX]; while (true) { @@ -217,7 +216,7 @@ approve_cert() { } #else struct stat statbuf; - if (stat(pathname.c_str(), &statbuf) != 0) { + if (stat(buf, &statbuf) != 0) { break; } #endif @@ -226,7 +225,7 @@ approve_cert() { // Sure, there's a slight race condition right now: another process // might attempt to create the same filename. So what. - FILE *fp = fopen(pathname.c_str(), "w"); + FILE *fp = fopen(buf, "w"); if (fp != NULL) { PEM_write_X509(fp, _cert); fclose(fp);