Skip to content

Commit

Permalink
Fix two warnings found by gcc-9.2:
Browse files Browse the repository at this point in the history
sockssrv.c: In function 'main':
sockssrv.c:430:17: warning: declaration of 'c' shadows a previous local [-Wshadow]
  430 |   struct client c;
      |                 ^
sockssrv.c:379:6: note: shadowed declaration is here
  379 |  int c;
      |      ^
sockssrv.c:405:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
  405 |     dprintf(2, "error: option -%c requires an operand\n", optopt);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sockssrv.c:406:4: note: here
  406 |    case '?':
      |    ^~~~
  • Loading branch information
Pavel Timofeev committed Aug 4, 2020
1 parent be54581 commit 578d14f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sockssrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,11 @@ static void zero_arg(char *s) {
}

int main(int argc, char** argv) {
int c;
int ch;
const char *listenip = "0.0.0.0";
unsigned port = 1080;
while((c = getopt(argc, argv, ":1b:i:p:u:P:")) != -1) {
switch(c) {
while((ch = getopt(argc, argv, ":1b:i:p:u:P:")) != -1) {
switch(ch) {
case '1':
auth_ips = sblist_new(sizeof(union sockaddr_union), 8);
break;
Expand All @@ -403,6 +403,7 @@ int main(int argc, char** argv) {
break;
case ':':
dprintf(2, "error: option -%c requires an operand\n", optopt);
/* fall through */
case '?':
return usage();
}
Expand Down

0 comments on commit 578d14f

Please sign in to comment.