From: NAKAMURA Takumi Date: Fri, 2 Nov 2012 01:32:02 +0000 (+0000) Subject: libprofile/CommonProfiling.c: Fix according to C89. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1cc9db3d649b79cb59e8831b83dcba1ff80121a;p=platform%2Fupstream%2Fllvm.git libprofile/CommonProfiling.c: Fix according to C89. llvm-svn: 167272 --- diff --git a/llvm/runtime/libprofile/CommonProfiling.c b/llvm/runtime/libprofile/CommonProfiling.c index 058270b..8f4119c 100644 --- a/llvm/runtime/libprofile/CommonProfiling.c +++ b/llvm/runtime/libprofile/CommonProfiling.c @@ -36,10 +36,10 @@ static const char *OutputFilename = "llvmprof.out"; * variable is set. If it is then save it and set OutputFilename. */ static void check_environment_variable(void) { + const char *EnvVar; if (SavedEnvVar) return; /* Guarantee that we can't leak memory. */ - const char *EnvVar = getenv("LLVMPROF_OUTPUT"); - if (EnvVar) { + if ((EnvVar = getenv("LLVMPROF_OUTPUT")) != NULL) { /* 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. */