diff options
author | Chad MILLER <chad@mysql.com> | 2008-08-11 11:28:35 -0400 |
---|---|---|
committer | Chad MILLER <chad@mysql.com> | 2008-08-11 11:28:35 -0400 |
commit | b615e3d535bfa28871bc3004bedef419a689b389 (patch) | |
tree | 227556138d0986e60ebbad44721ccc3a1fa397d4 /client/mysql_upgrade.c | |
parent | abeda651c5929af02f4f80f0ac9934fb0a73db5e (diff) | |
download | mariadb-git-b615e3d535bfa28871bc3004bedef419a689b389.tar.gz |
Backport compiler warning fix from 5.1-bugteam.
Diffstat (limited to 'client/mysql_upgrade.c')
-rw-r--r-- | client/mysql_upgrade.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 15fa6622f74..74e8c9dd577 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -364,7 +364,9 @@ static void find_tool(char *tool_executable_name, const char *tool_name, } else { - /* + int len; + + /* mysql_upgrade was run absolutely or relatively. We can find a sibling by replacing our name after the LIBCHAR with the new tool name. */ @@ -385,10 +387,10 @@ static void find_tool(char *tool_executable_name, const char *tool_name, last_fn_libchar -= 6; } + len= last_fn_libchar - self_name; + my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s", - (last_fn_libchar - self_name), self_name, - FN_LIBCHAR, - tool_name); + len, self_name, FN_LIBCHAR, tool_name); } verbose("Looking for '%s' as: %s", tool_name, tool_executable_name); |