diff options
author | Jay Freeman <saurik@saurik.com> | 2008-01-01 05:58:43 +0000 |
---|---|---|
committer | Jay Freeman <saurik@saurik.com> | 2008-01-01 05:58:43 +0000 |
commit | ea2670c18699e514ee1d65dfd35ad22c296a74e7 (patch) | |
tree | 6826a5266d78c22210c194772a8daed06ef0a19c /data/psmisc/getline.diff | |
parent | a45e85d54e8df7a333946cc52fec519fc6aa4d87 (diff) |
Initial commit.
git-svn-id: http://svn.telesphoreo.org/trunk@2 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data/psmisc/getline.diff')
-rw-r--r-- | data/psmisc/getline.diff | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/data/psmisc/getline.diff b/data/psmisc/getline.diff new file mode 100644 index 000000000..9b2b3d44d --- /dev/null +++ b/data/psmisc/getline.diff @@ -0,0 +1,32 @@ +diff -r -u psmisc-22.6/src/killall.c psmisc-22.6+iPhone/src/killall.c +--- psmisc-22.6/src/killall.c 2007-06-03 10:58:09.000000000 +0000 ++++ psmisc-22.6+iPhone/src/killall.c 2007-12-27 13:28:53.000000000 +0000 +@@ -64,9 +64,8 @@ + { + int res; + size_t len; +- char *line; ++ char line[1024]; + +- line = NULL; + len = 0; + + do { +@@ -79,16 +78,14 @@ + + fflush (stdout); + +- if (getline (&line, &len, stdin) < 0) ++ if (fgets(line, sizeof(line), stdin) == NULL) + return 0; + /* Check for default */ + if (line[0] == '\n') { +- free(line); + return 0; + } + res = rpmatch(line); + if (res >= 0) { +- free(line); + return res; + } + } while(1); |