diff options
author | Duncan Sands <baldrick@free.fr> | 2008-06-19 08:47:31 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-06-19 08:47:31 +0000 |
commit | db356eea26f693b6fe0165bb78afaa52cd3ef18e (patch) | |
tree | 94f7b34b919ff56344fcb0f85f9b8d215d1654d2 /llvm/tools/llvm-stub/llvm-stub.c | |
parent | 849fa11f15185ac2bf97814f46505ddd87b6218a (diff) | |
download | bcm5719-llvm-db356eea26f693b6fe0165bb78afaa52cd3ef18e.tar.gz bcm5719-llvm-db356eea26f693b6fe0165bb78afaa52cd3ef18e.zip |
Fix some warnings reported by gcc-4.3. Hopefully
this still compiles on windows - I can't test!
llvm-svn: 52488
Diffstat (limited to 'llvm/tools/llvm-stub/llvm-stub.c')
-rw-r--r-- | llvm/tools/llvm-stub/llvm-stub.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/tools/llvm-stub/llvm-stub.c b/llvm/tools/llvm-stub/llvm-stub.c index 91537a0b9cc..18d20e7d0c9 100644 --- a/llvm/tools/llvm-stub/llvm-stub.c +++ b/llvm/tools/llvm-stub/llvm-stub.c @@ -38,7 +38,6 @@ int main(int argc, char** argv) { const char *Interp = getenv("LLVMINTERP"); const char **Args; - int len; if (Interp == 0) Interp = "lli"; /* Set up the command line options to pass to the JIT. */ @@ -47,12 +46,14 @@ int main(int argc, char** argv) { Args[0] = Interp; #ifdef LLVM_ON_WIN32 - len = strlen(argv[0]); - if (len < 4 || strcmp(argv[0] + len - 4, ".exe") != 0) { - /* .exe suffix is stripped off of argv[0] if the executable was run on the - * command line without one. Put it back on. - */ - argv[0] = strcat(strcpy((char*)malloc(len + 5), argv[0]), ".exe"); + { + int len = strlen(argv[0]); + if (len < 4 || strcmp(argv[0] + len - 4, ".exe") != 0) { + /* .exe suffix is stripped off of argv[0] if the executable was run on the + * command line without one. Put it back on. + */ + argv[0] = strcat(strcpy((char*)malloc(len + 5), argv[0]), ".exe"); + } } #endif |