mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-29 15:37:46 +00:00
libprofile/CommonProfiling.c: Fix according to C89.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167272 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9b25ff66dd
commit
875618f245
@ -36,10 +36,10 @@ static const char *OutputFilename = "llvmprof.out";
|
|||||||
* variable is set. If it is then save it and set OutputFilename.
|
* variable is set. If it is then save it and set OutputFilename.
|
||||||
*/
|
*/
|
||||||
static void check_environment_variable(void) {
|
static void check_environment_variable(void) {
|
||||||
|
const char *EnvVar;
|
||||||
if (SavedEnvVar) return; /* Guarantee that we can't leak memory. */
|
if (SavedEnvVar) return; /* Guarantee that we can't leak memory. */
|
||||||
|
|
||||||
const char *EnvVar = getenv("LLVMPROF_OUTPUT");
|
if ((EnvVar = getenv("LLVMPROF_OUTPUT")) != NULL) {
|
||||||
if (EnvVar) {
|
|
||||||
/* The string that getenv returns is allowed to be statically allocated,
|
/* The string that getenv returns is allowed to be statically allocated,
|
||||||
* which means it may be changed by future calls to getenv, so copy it.
|
* which means it may be changed by future calls to getenv, so copy it.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user