Index: tools/android/forwarder2/host_forwarder_main.cc |
diff --git a/tools/android/forwarder2/host_forwarder_main.cc b/tools/android/forwarder2/host_forwarder_main.cc |
index 1b3bf5d8264456132752fbdaa526870042652716..5ba02a25d3f828f27a21fe08f775d6c84f78472b 100644 |
--- a/tools/android/forwarder2/host_forwarder_main.cc |
+++ b/tools/android/forwarder2/host_forwarder_main.cc |
@@ -77,6 +77,11 @@ int main(int argc, char** argv) { |
printf("Could not parse adb port number: %s\n", adb_port_str.c_str()); |
show_help = true; |
} |
+ if (adb_port <= 0) { |
+ printf("Invalid adb port number: %s. Adb port must be a " |
+ "postivie integer.\n", adb_port_str.c_str()); |
+ show_help = true; |
+ } |
CommandLine::StringVector forward_args = command_line.GetArgs(); |
if (show_help || forward_args.empty()) { |
tools::ShowHelp( |
@@ -89,7 +94,7 @@ int main(int argc, char** argv) { |
" <Forward to port> default is <Device port>\n" |
" <Forward to address> default is 127.0.0.1.", |
kDefaultAdbPort).c_str()); |
- return 0; |
+ return -1; |
Philippe
2012/10/01 22:38:06
Sorry to catch this only now. main()'s exit code i
felipeg
2012/10/01 22:42:41
Yep, the return value doesn't matter here. I just
Isaac (away)
2012/10/01 22:45:37
Please change this to a positive value.
|
} |
g_notifier = new forwarder2::PipeNotifier(); |