X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=examples%2Fgroupchat.c;h=75e259db7d1d8ed16caee6e7cac92abe9b0043f4;hb=5f2e8877486869471041b0eca1aaed841c41a1a9;hp=7a5a300fb526f7f8be3790338e90a10ca3e9831e;hpb=ac63b6adaf29c4143f9e106039011b9ebeb96b93;p=meshlink diff --git a/examples/groupchat.c b/examples/groupchat.c index 7a5a300f..75e259db 100644 --- a/examples/groupchat.c +++ b/examples/groupchat.c @@ -129,7 +129,7 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { } if(!s) { - fprintf(stderr, "Group is not yet creted!\n"); + fprintf(stderr, "Group is not yet created!\n"); return; } } @@ -227,7 +227,10 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { return; } - meshlink_blacklist(mesh, node); + if(!meshlink_blacklist(mesh, node)) { + fprintf(stderr, "Error blacklising '%s': %s", arg, meshlink_strerror(meshlink_errno)); + return; + } fprintf(stderr, "Node '%s' blacklisted.\n", arg); } else if(!strcasecmp(buf, "whitelist")) { @@ -243,7 +246,10 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { return; } - meshlink_whitelist(mesh, node); + if(!meshlink_whitelist(mesh, node)) { + fprintf(stderr, "Error whitelising '%s': %s", arg, meshlink_strerror(meshlink_errno)); + return; + } fprintf(stderr, "Node '%s' whitelisted.\n", arg); } else if(!strcasecmp(buf, "who")) {