250 Commits

Author SHA1 Message Date
Sebastian Pipping
0c5b205a01 xmlwf: Address clang-tidy warning bugprone-narrowing-conversions
The symptom was:
> [..]/expat/xmlwf/xmlfile.c:204:13: error: narrowing conversion from 'ssize_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   204 |     nread = read(fd, buf, g_read_size_bytes);
>       |             ^
> [..]/expat/xmlwf/xmlwf.c:314:14: error: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors]
>   314 |   numBytes = count * sizeof(XML_Char);
>       |              ^

The solution to read(3) was copied from file xmlwf/readfilemap.c for now.
2025-03-30 18:52:09 +02:00
Sebastian Pipping
bf4bc5cfcf xmlwf/unixfilemap.c: Simplify "(void *)0" to NULL 2025-03-30 18:52:09 +02:00
Sebastian Pipping
d620de0f50 xmlwf/unixfilemap.c: Address clang-tidy warning google-readability-casting 2025-03-30 18:52:09 +02:00
Sebastian Pipping
2ae4c8afd3 Sync file headers 2025-03-13 20:41:33 +01:00
Hanno Böck
afd87e8399 Update opengroup link/comment to https 2025-03-04 22:24:28 +01:00
Sebastian Pipping
750c985f11 Sync file headers 2024-11-06 17:42:20 +01:00
Hanno Böck
d827287012 Cast enum vars to unsigned int if used in printf
It is not specified by the C standard whether enum is unsigned,
therefore, make sure it is always unsigned if we print it as a
number.
2024-10-23 17:02:31 +02:00
Hanno Böck
424dd12400 Fix signedness of format strings
Format strings used %d to print variables with unsigned values.
Changing to %u to match signedness.
Fixes "clang -Wformat-signedness" warnings.
2024-10-20 08:45:59 +02:00
Sebastian Pipping
2a10e173ab Sync file headers 2024-02-06 14:13:00 +01:00
Sebastian Pipping
09fdf998e7 xmlwf: Support disabling reparse deferral
Rebased-and-adapted-by: Snild Dolkow <snild@sony.com>
2024-01-29 19:59:18 +01:00
Sebastian Pipping
caa2719863 Simplify "defined(XML_DTD) || XML_GE == 1" to "XML_GE == 1" 2023-11-07 13:00:42 +01:00
Sebastian Pipping
2848dc4e70 Simplify "! defined(XML_DTD) && XML_GE == 0" to "XML_GE == 0" 2023-11-07 13:00:42 +01:00
Sebastian Pipping
0f075ec8ec lib|xmlwf|cmake: Extend scope of billion laughs attack protection
.. from "defined(XML_DTD)" to "defined(XML_DTD) || XML_GE==1".
2023-11-06 20:43:09 +01:00
clang-format
a392427d3a Mass-apply clang-format 17.0.3 using ./apply-clang-format.sh 2023-10-20 23:49:51 +02:00
Sebastian Pipping
ab43d8d116 Make inclusion to expat_config.h consistent
.. and priorize the local build over the system header.
2023-10-04 19:58:28 +02:00
Sebastian Pipping
92cdc783f1 xmlwf: Get help output alignment back in order 2023-09-29 12:55:17 +02:00
Sebastian Pipping
4c6731ad11 xmlwf: Use XMLWF_EXIT_SUCCESS where missing 2023-09-29 12:55:17 +02:00
Sebastian Pipping
0b3ef852bc xmlwf: Support --help and --version 2023-09-29 12:55:17 +02:00
Sebastian Pipping
900d2a7cd2 xmlwf: Better document that usage(..) calls exit(..) 2023-09-29 12:55:17 +02:00
Sebastian Pipping
bc26bc5896 xmlwf: Break up conditional before upcoming extension 2023-09-29 12:06:05 +02:00
Sebastian Pipping
d248e7e923 xmlwf: Support custom buffer size for XML_GetBuffer and read 2023-09-28 17:06:39 +02:00
Donghee Na
e52b6b8b8c Update legal name of Donghee Na (#754) 2023-09-24 18:13:03 +02:00
Sebastian Pipping
2f2cda0a2a xmlwf: Improve language and URL clickability in help output 2023-09-11 21:54:24 +02:00
Sean McBride
c094e450a1 Fixed some clang -Wcast-qual warnings
Mostly added various missing consts, thus eliminating the casting away of constness. In a few cases, just removed unnecessary casts entirely.
2022-11-01 18:54:12 -04:00
Sean McBride
fc594f380d Fixed some -Wcast-qual warnings by just using NULL for default value of output param
The `endptr` parameter of both tcstof() and strtoul() are output-only; its initial value is not read, and so may as well be NULL.
2022-11-01 17:20:26 -04:00
Sean McBride
0212538640 Fixed most clang -Wreserved-id-macro warnings
Renamed to not start with underscore + uppercase, which is reserved.
2022-10-25 09:06:44 -04:00
Sean McBride
2ee10be8c8 Fixed all clang -Wconditional-uninitialized warnings
Just initialized to zero to shut the compiler up.
2022-10-25 09:03:12 -04:00
Sebastian Pipping
55b79f4d88 Sync file headers 2022-09-19 16:20:44 +02:00
Sebastian Pipping
39b2e99355 Sync file headers 2022-07-14 22:26:59 +02:00
orbitcowboy
4ead0836c5
Fixed typo in nsattcmp attribute handling 2022-04-01 16:37:13 +02:00
orbitcowboy
399a65e637
Assign LPVOID pointer with NULL before it's being used
This fixes https://github.com/libexpat/libexpat/issues/592
2022-03-30 14:29:20 +02:00
Sebastian Pipping
317c91776a Sync file headers 2022-02-15 21:23:29 +01:00
Sebastian Pipping
039af6611d Sync file headers 2022-01-29 23:28:05 +01:00
Sebastian Pipping
85a6f8fcdb xmlwf: Fix a memory leak on output file opening error 2022-01-24 15:41:32 +01:00
Sebastian Pipping
c2b5d52404 xmlwf: Address Clang 13 warning -Wunused-but-set-variable 2021-12-26 19:51:44 +01:00
Sebastian Pipping
c3300c9bf2 Get attribution headers back in sync
Follow-up to pull requests #503 and #510
2021-10-17 16:35:12 +02:00
Sebastian Pipping
c05efa1fbf Apply #514 to attribution headers 2021-10-17 16:28:01 +02:00
Dong-hee Na
59734d6e31 Reorder the location of including expat_config.h 2021-10-17 20:45:24 +09:00
Sebastian Pipping
0b7a88b355 Autotools|CMake: Link against libm for function "isnan"
$ git --no-pager grep -lw isnan
lib/xmlparse.c
tests/runtests.c
xmlwf/xmlwf.c
2021-09-20 18:27:52 +02:00
Sebastian Pipping
c6223b3b0f xmlwf: Add support for custom attack protection parameters 2021-05-07 18:25:07 +02:00
Sebastian Pipping
65cddaa4e9 xmlwf: Include expat_config.h so we can check for macro XML_DTD 2021-05-07 18:25:07 +02:00
Sebastian Pipping
df42f935bf Increase precision in existing MIT headers based on Git history 2021-05-02 19:53:29 +02:00
Sebastian Pipping
c028d9b280 xmlwf: Simplify synopsis 2021-04-25 17:49:21 +02:00
Sebastian Pipping
8d1bd6ff2c Resolve macro HAVE_EXPAT_CONFIG_H 2021-04-22 00:11:28 +02:00
Sebastian Pipping
810e240fde xmlwf: Extract exit code constants 2021-04-19 19:32:29 +02:00
Sebastian Pipping
385aeb477b xmlwf: Extract macro XMLWF_SHIFT_ARGUMENT 2021-04-19 19:30:12 +02:00
Sebastian Pipping
a6f3f2a3a2 xmlwf: Split off exit status 4 for invalid argument invokation 2021-03-20 18:20:09 +01:00
Tim Bray
56c18c63ed Add argument -k to allow continuing after non-fatal errors 2021-03-16 20:40:26 -07:00
Kleber Tarcísio
12a7276f3e xmlwf: Checks value after calling malloc 2020-06-22 19:56:34 +02:00
Joe Orton
f1634dbaea Update xmlwf to exit with 3 if an output file could not be opened.
Update xmlwf exit code docs per review.
2020-05-13 08:36:56 +01:00