projects
/
cycript.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
96d36aa
)
With -p on all platforms, we can't use asprintf().
master
author
Jay Freeman (saurik)
<saurik@saurik.com>
Tue, 6 Sep 2016 03:51:38 +0000
(20:51 -0700)
committer
Jay Freeman (saurik)
<saurik@saurik.com>
Tue, 6 Sep 2016 03:51:38 +0000
(20:51 -0700)
Console.cpp
patch
|
blob
|
blame
|
history
diff --git
a/Console.cpp
b/Console.cpp
index 7f68ecd3473b13c92073c50316b25add601f0513..424c97fdc83f56130c696545322c5ece97dcd403 100644
(file)
--- a/
Console.cpp
+++ b/
Console.cpp
@@
-965,9
+965,8
@@
int Main(int argc, char * const argv[], char const * const envp[]) {
if (optarg + size != end) {
// XXX: arg needs to be escaped in some horrendous way of doom
// XXX: this is a memory leak now because I just don't care enough
if (optarg + size != end) {
// XXX: arg needs to be escaped in some horrendous way of doom
// XXX: this is a memory leak now because I just don't care enough
- char *command;
- int writ(asprintf(&command, "ps axc|sed -e '/^ *[0-9]/{s/^ *\\([0-9]*\\)\\( *[^ ]*\\)\\{3\\} *-*\\([^ ]*\\)/\\3 \\1/;/^%s /{s/^[^ ]* //;q;};};d'", optarg));
- _assert(writ != -1);
+ CYPool pool;
+ char *command(pool.sprintf(strlen(optarg) + 256, "ps axc|sed -e '/^ *[0-9]/{s/^ *\\([0-9]*\\)\\( *[^ ]*\\)\\{3\\} *-*\\([^ ]*\\)/\\3 \\1/;/^%s /{s/^[^ ]* //;q;};};d'", optarg));
if (FILE *pids = popen(command, "r")) {
char value[32];
if (FILE *pids = popen(command, "r")) {
char value[32];