summaryrefslogtreecommitdiff
path: root/toxcore/onion_announce.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-01-28 21:30:39 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-01-30 23:35:50 +0000
commit92ffad1a72bc8c422426d52ac408bd71242dd047 (patch)
treef592f353068dd2043525dd2cc04d6124a4ed4bc4 /toxcore/onion_announce.c
parent623e9ac331df7323660e21c8a2226523a5ee713b (diff)
Use nullptr as NULL pointer constant instead of NULL or 0.
This changes only code, no string literals or comments.
Diffstat (limited to 'toxcore/onion_announce.c')
-rw-r--r--toxcore/onion_announce.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c
index 0ff22a3d..585e78a1 100644
--- a/toxcore/onion_announce.c
+++ b/toxcore/onion_announce.c
@@ -493,14 +493,14 @@ static int handle_data_request(void *object, IP_Port source, const uint8_t *pack
493 493
494Onion_Announce *new_onion_announce(DHT *dht) 494Onion_Announce *new_onion_announce(DHT *dht)
495{ 495{
496 if (dht == NULL) { 496 if (dht == nullptr) {
497 return NULL; 497 return nullptr;
498 } 498 }
499 499
500 Onion_Announce *onion_a = (Onion_Announce *)calloc(1, sizeof(Onion_Announce)); 500 Onion_Announce *onion_a = (Onion_Announce *)calloc(1, sizeof(Onion_Announce));
501 501
502 if (onion_a == NULL) { 502 if (onion_a == nullptr) {
503 return NULL; 503 return nullptr;
504 } 504 }
505 505
506 onion_a->dht = dht; 506 onion_a->dht = dht;
@@ -515,11 +515,11 @@ Onion_Announce *new_onion_announce(DHT *dht)
515 515
516void kill_onion_announce(Onion_Announce *onion_a) 516void kill_onion_announce(Onion_Announce *onion_a)
517{ 517{
518 if (onion_a == NULL) { 518 if (onion_a == nullptr) {
519 return; 519 return;
520 } 520 }
521 521
522 networking_registerhandler(onion_a->net, NET_PACKET_ANNOUNCE_REQUEST, NULL, NULL); 522 networking_registerhandler(onion_a->net, NET_PACKET_ANNOUNCE_REQUEST, nullptr, nullptr);
523 networking_registerhandler(onion_a->net, NET_PACKET_ONION_DATA_REQUEST, NULL, NULL); 523 networking_registerhandler(onion_a->net, NET_PACKET_ONION_DATA_REQUEST, nullptr, nullptr);
524 free(onion_a); 524 free(onion_a);
525} 525}