Skip to content

Commit

Permalink
tftpd: Make the -d option behave as documented.
Browse files Browse the repository at this point in the history
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38965
  • Loading branch information
dag-erling committed Mar 10, 2023
1 parent 92570f6 commit 9f6f649
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libexec/tftpd/tftpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ main(int argc, char *argv[])
acting_as_client = 0;

tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
while ((ch = getopt(argc, argv, "cCd:F:lnoOp:s:u:U:wW")) != -1) {
while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:u:U:wW")) != -1) {
switch (ch) {
case 'c':
ipchroot = 1;
Expand All @@ -149,7 +149,9 @@ main(int argc, char *argv[])
ipchroot = 2;
break;
case 'd':
if (atoi(optarg) != 0)
if (optarg == NULL)
debug++;
else if (atoi(optarg) != 0)
debug += atoi(optarg);
else
debug |= debug_finds(optarg);
Expand Down

0 comments on commit 9f6f649

Please sign in to comment.