diff options
author | Nils Gillmann <ng0@n0.is> | 2018-06-25 12:19:27 +0000 |
---|---|---|
committer | Nils Gillmann <ng0@n0.is> | 2018-06-25 12:19:27 +0000 |
commit | fed9e8bfb74ba162567ea8dfdcc48ac49c1a02e4 (patch) | |
tree | 9a9c18e036b51eedd99079d7ce726ecc80c4e1a6 | |
parent | 4559466ac3cf7bd7452a0fcfdc2d7b950ec10568 (diff) | |
parent | 64e37887ea50a99b2ff4a3991d75dab9ea2a0c49 (diff) |
Merge branch 'master' of gnunet.org:gnunet
-rw-r--r-- | src/rps/gnunet-rps.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rps/gnunet-rps.c b/src/rps/gnunet-rps.c index e09277589..739f71dac 100644 --- a/src/rps/gnunet-rps.c +++ b/src/rps/gnunet-rps.c @@ -155,7 +155,11 @@ run (void *cls, (!view_update)) { /* Request n PeerIDs */ /* If number was specified use it, else request single peer. */ - num_peers = (NULL == args[0]) ? 1 : atoi (args[0]); + if (NULL == args[0] || + 0 == sscanf (args[0], "%lu", &num_peers)) + { + num_peers = 1; + } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Requesting %" PRIu64 " PeerIDs\n", num_peers); req_handle = GNUNET_RPS_request_peers (rps_handle, num_peers, reply_handle, NULL); @@ -163,7 +167,11 @@ run (void *cls, } else if (view_update) { /* Get updates of view */ - num_view_updates = (NULL == args[0]) ? 0 : atoi (args[0]); + if (NULL == args[0] || + 0 == sscanf (args[0], "%lu", &num_view_updates)) + { + num_view_updates = 0; + } GNUNET_RPS_view_request (rps_handle, num_view_updates, view_update_handle, NULL); if (0 != num_view_updates) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |