example.c: improve check for number of arguments - uriparser - URI parser
HTML git clone git://git.codemadness.org/uriparser
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 163a287064136357289d48a806b63ab19a3372e7
DIR parent f003f99bc853675e14235c2750a31571c988543b
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 23 Nov 2023 20:29:30 +0100
example.c: improve check for number of arguments
Be more strict, silently accepting something might give wrong expectations.
Diffstat:
M example.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/example.c b/example.c
@@ -21,7 +21,7 @@ main(int argc, char *argv[])
char buf[4096];
int r;
- if (argc < 2) {
+ if (argc < 2 || argc > 3) {
fprintf(stderr, "usage: %s <url> [baseurl]\n", argv[0]);
return 1;
}