Skip to content
Permalink
Browse files

Fix warnings

  • Loading branch information...
ckolivas committed Oct 14, 2014
1 parent 5dead59 commit 8a7ee643c3fee00a67907b12588ac7cac4fdf984
Showing with 2 additions and 3 deletions.
  1. +2 −3 api.c
5 api.c
@@ -4434,9 +4434,9 @@ static void setup_groups()
static void setup_ipaccess()
{
char *buf, *ptr, *comma, *slash, *end;
int ipcount, mask, octet, i, shift;
int ipcount, mask, i, shift;
bool ipv6 = false;
char group;
bool ipv6;
char tmp[30];

buf = malloc(strlen(opt_api_allow) + 1);
@@ -4495,7 +4495,6 @@ static void setup_ipaccess()
ipaccess[ips].mask.s6_addr[i] = 0xff;
else {
slash = end--;
ipv6 = false;

This comment has been minimized.

Copy link
@archangdcc

archangdcc Oct 23, 2014

Should keep this line in case we get a v4 after v6 in the api-allow list.
Say, "--api-allow W:[2001::]/16,192.168.0.0/8" will cause some problem.

This comment has been minimized.

Copy link
@ckolivas

ckolivas Oct 23, 2014

Author Owner

The warning was about an uninitialised variable, not about command line parameters.

This comment has been minimized.

Copy link
@archangdcc

archangdcc Oct 23, 2014

I mean, this variable should be reset to false in every loop run.

This comment has been minimized.

Copy link
@ckolivas

ckolivas via email Oct 23, 2014

Author Owner
if (*ptr == '[' && *end == ']') {
*(ptr++) = '\0';
*(end--) = '\0';

0 comments on commit 8a7ee64

Please sign in to comment.
You can’t perform that action at this time.