From 3166410a82f43d39201be98a8d35c51baa86cb53 Mon Sep 17 00:00:00 2001 From: Alexey Tarasov Date: Thu, 22 Oct 2009 02:55:00 +1100 Subject: Make get_my_path() safer Adds maxLen parameter to get_my_path(). Some small cosmetic fixes. --- adb/commandline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'adb/commandline.c') diff --git a/adb/commandline.c b/adb/commandline.c index 055aa10..52bcedc 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; -- cgit v1.1