diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-10 10:33:19 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-10 10:33:19 +0000 |
commit | 2d184134b0ac47f42d70cf1c9fa80cbb5964f828 (patch) | |
tree | c8c2d44962685da8dfd18caaacf65d75f0f34c08 /src/peerinfo-tool/gnunet-peerinfo.c | |
parent | d1161f4ec0637717c8a4f1af1c8ad41b8b14463a (diff) | |
download | gnunet-2d184134b0ac47f42d70cf1c9fa80cbb5964f828.tar.gz gnunet-2d184134b0ac47f42d70cf1c9fa80cbb5964f828.zip |
fix: infinite loop if option was given
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo.c')
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index 34262aa6d..ba311dced 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c | |||
@@ -145,6 +145,11 @@ static int get_self; | |||
145 | static int get_uri; | 145 | static int get_uri; |
146 | 146 | ||
147 | /** | 147 | /** |
148 | * Option | ||
149 | */ | ||
150 | static int default_operation; | ||
151 | |||
152 | /** | ||
148 | * Option '-i' | 153 | * Option '-i' |
149 | */ | 154 | */ |
150 | static int get_info; | 155 | static int get_info; |
@@ -730,6 +735,7 @@ state_machine (void *cls, | |||
730 | printf ("%s\n", (char *) &enc); | 735 | printf ("%s\n", (char *) &enc); |
731 | else | 736 | else |
732 | printf (_("I am peer `%s'.\n"), (const char *) &enc); | 737 | printf (_("I am peer `%s'.\n"), (const char *) &enc); |
738 | |||
733 | } | 739 | } |
734 | else if (GNUNET_YES == get_uri) | 740 | else if (GNUNET_YES == get_uri) |
735 | { | 741 | { |
@@ -745,9 +751,10 @@ state_machine (void *cls, | |||
745 | TIMEOUT, &dump_my_hello, NULL); | 751 | TIMEOUT, &dump_my_hello, NULL); |
746 | return; | 752 | return; |
747 | } | 753 | } |
748 | else | 754 | else if (GNUNET_YES == default_operation) |
749 | { | 755 | { |
750 | /* default operation list all */ | 756 | /* default operation list all */ |
757 | default_operation = GNUNET_NO; | ||
751 | get_info = GNUNET_YES; | 758 | get_info = GNUNET_YES; |
752 | tt = GNUNET_SCHEDULER_add_now (&state_machine, NULL); | 759 | tt = GNUNET_SCHEDULER_add_now (&state_machine, NULL); |
753 | return; | 760 | return; |
@@ -768,6 +775,7 @@ state_machine (void *cls, | |||
768 | int | 775 | int |
769 | main (int argc, char *const *argv) | 776 | main (int argc, char *const *argv) |
770 | { | 777 | { |
778 | default_operation = GNUNET_YES; | ||
771 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 779 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
772 | {'n', "numeric", NULL, | 780 | {'n', "numeric", NULL, |
773 | gettext_noop ("don't resolve host names"), | 781 | gettext_noop ("don't resolve host names"), |