(!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);
} 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,