Repository: yt-dlp
Issue: --max-downloads generates warning even when the limit was not exceeded
Labels: bug,triage

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2023.02.17** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Provide a description that is worded well enough to be understood

When using the option `--max-downloads <limit>` if the limit is reached but not exceeded, yt-dlp will output

> [info] Maximum number of downloads reached, stopping due to --max-downloads
> Aborting remaining downloads

and exit with status `101`; Even though there is no "remaining downloads" to abort.

For instance `--max-downloads 1` will always produce the above output and return 101 even when doing a single download.

I would expect to get the message and 101 status only if there actually was strictly more downloads to be done than the set limit.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['https://www.youtube.com/watch?v=aqz-KE-bpKQ', '--max-downloads', '1', '-vU', '-f', 'ba']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.02.17 [a0a7c01] (pip)
[debug] Python 3.10.6 (CPython x86_64 64bit) - Linux-5.15.0-48-generic-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.11.0, brotli-1.0.9, certifi-2020.06.20, mutagen-1.45.1, pyxattr-0.7.2, secretstorage-3.3.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1782 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.02.17, Current version: 2023.02.17
yt-dlp is up to date (2023.02.17)
[youtube] Extracting URL: https://www.youtube.com/watch?v=aqz-KE-bpKQ
[youtube] aqz-KE-bpKQ: Downloading webpage
[youtube] aqz-KE-bpKQ: Downloading android player API JSON
[debug] Loading youtube-nsig.11e3a4ec from cache
[debug] [youtube] Decrypted nsig syXCvH2ENKRebldK => Oicnk5NWqIkYFg
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] aqz-KE-bpKQ: Downloading 1 format(s): 258
[debug] Invoking http downloader on "..."
[download] Destination: Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].m4a
[download] 100% of   29.34MiB in 00:00:01 at 22.58MiB/s
[FixupM4a] Correcting container of "Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].m4a"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].m4a' -map 0 -dn -ignore_unknown -c copy -f mp4 -movflags +faststart 'file:Big Buck Bunny 60fps 4K - Official Blender Foundation Short Film [aqz-KE-bpKQ].temp.m4a'
[info] Maximum number of downloads reached, stopping due to --max-downloads
Aborting remaining downloads
```