Skip to content

Commit

Permalink
silence lint false positive (tapname == NULL)
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Jan 5, 2022
1 parent 0138605 commit dbf96f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ static int open_tap(const char *tapname)
{
int fd;
struct ifreq ifr;
if (tapname == NULL) {
fprintf(stderr, "tapname is NULL\n");
return -1;
}
if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
perror("open(\"/dev/net/tun\")");
return fd;
Expand Down

0 comments on commit dbf96f1

Please sign in to comment.