diff mbox

[4/5] Fix test-ptrace argument parsing.

Message ID 1299084010-8762-5-git-send-email-ken.werner@linaro.org
State Accepted
Commit 13cd3b0c261f880b51133624549a062c77cd5fbb
Headers show

Commit Message

Ken Werner March 2, 2011, 4:40 p.m. UTC
From: Zachary T Welch <zwelch@codesourcery.com>

Avoids an endless loop when passing unknown options.

Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
Signed-off-by: Ken Werner <ken.werner@linaro.org>
---
 tests/test-ptrace.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/tests/test-ptrace.c b/tests/test-ptrace.c
index b7de682..c9f8f2e 100644
--- a/tests/test-ptrace.c
+++ b/tests/test-ptrace.c
@@ -202,6 +202,8 @@  main (int argc, char **argv)
 	else if (strcmp (argv[optind], "-n") == 0)
 	  /* Don't look-up and print symbol names.  */
 	  ++optind, print_names = 0;
+	else
+	  fprintf(stderr, "unrecognized option: %s\n", argv[optind++]);
       }
 
   target_pid = fork ();