diff options
| author | Alexey Tarasov <tarasov@dodologics.com> | 2009-10-22 02:55:00 +1100 |
|---|---|---|
| committer | Alexey Tarasov <tarasov@dodologics.com> | 2009-10-22 02:55:00 +1100 |
| commit | 3166410a82f43d39201be98a8d35c51baa86cb53 (patch) | |
| tree | 484564e35ef296e3e2a029d5710bee7c672f1129 /adb/commandline.c | |
| parent | 74d7ff8cfd490852d3df1c4b9d8a21beed619caa (diff) | |
| download | system_core-3166410a82f43d39201be98a8d35c51baa86cb53.tar.gz system_core-3166410a82f43d39201be98a8d35c51baa86cb53.tar.bz2 system_core-3166410a82f43d39201be98a8d35c51baa86cb53.zip | |
Make get_my_path() safer
Adds maxLen parameter to get_my_path().
Some small cosmetic fixes.
Diffstat (limited to 'adb/commandline.c')
| -rw-r--r-- | adb/commandline.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/adb/commandline.c b/adb/commandline.c index 055aa104..52bcedc2 100644 --- a/adb/commandline.c +++ b/adb/commandline.c @@ -50,7 +50,7 @@ enum { static int do_cmd(transport_type ttype, char* serial, char *cmd, ...); -void get_my_path(char s[PATH_MAX]); +void get_my_path(char *s, size_t maxLen); int find_sync_dirs(const char *srcarg, char **android_srcdir_out, char **data_srcdir_out); int install_app(transport_type transport, char* serial, int argc, char** argv); @@ -673,7 +673,7 @@ static char *find_top(char path_buf[PATH_MAX]) /* If the CWD isn't under a good-looking top, see if the * executable is. */ - get_my_path(dir); + get_my_path(dir, PATH_MAX); top = find_top_from(dir, path_buf); } return top; |
