From: Jay Freeman (saurik) Date: Sat, 11 Oct 2014 09:09:10 +0000 (-0700) Subject: Correct "error: taking address of temporary array". X-Git-Tag: v0.9.503~27 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/f61fec22c57591cca36aae67775c4cd52a5411bc?ds=inline Correct "error: taking address of temporary array". --- diff --git a/Console.cpp b/Console.cpp index 209eef3..2b68edd 100644 --- a/Console.cpp +++ b/Console.cpp @@ -403,7 +403,8 @@ class History { ~History() { if (append_history$ != NULL) { - _syscall(close(_syscall(open(histfile_.c_str(), O_CREAT | O_WRONLY, 0600)))); + int fd(_syscall(open(histfile_.c_str(), O_CREAT | O_WRONLY, 0600))); + _syscall(close(fd)); _assert((*append_history$)(histlines_, histfile_.c_str()) == 0); } else { _assert(write_history(histfile_.c_str()) == 0); @@ -633,7 +634,7 @@ int Main(int argc, char * const argv[], char const * const envp[]) { #endif "r:" "s" - , (struct option[]) { + , (const struct option[]) { {NULL, no_argument, NULL, 'c'}, {NULL, required_argument, NULL, 'g'}, {NULL, required_argument, NULL, 'n'},