diff options
| author | Lion Kortlepel <[email protected]> | 2026-02-01 16:52:01 +0000 |
|---|---|---|
| committer | Lion Kortlepel <[email protected]> | 2026-02-01 16:52:01 +0000 |
| commit | e34787eaa97b60a2ca50052878f0fcdc42818f69 (patch) | |
| tree | 27bf9e45dbed0fd4c14a45b0b48dcfb1d00af462 /examples | |
| parent | e933171609b676556f70834cbf48b441c7ed8060 (diff) | |
| download | args-e34787eaa97b60a2ca50052878f0fcdc42818f69.tar.zst args-e34787eaa97b60a2ca50052878f0fcdc42818f69.zip | |
fix: fix example crash under tcc
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/basic_example.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/basic_example.c b/examples/basic_example.c index 43413f4..5c6c3bd 100644 --- a/examples/basic_example.c +++ b/examples/basic_example.c @@ -6,7 +6,7 @@ int main(int argc, char** argv) { int help = 0; const char* outfile = "out.txt"; const char* infile; - const char* testfile; + const char* testfile = NULL; ls_args_init(&args); args.help_description = "An example program to show how arguments work. " @@ -29,7 +29,7 @@ int main(int argc, char** argv) { printf("Got input file: %s\n", infile); printf("Got output file: %s\n", outfile); - printf("Got test file: %s\n", testfile); + printf("Got test file: %s\n", testfile ? testfile : "(null)"); ls_args_free(&args); return 0; |
