[libxml2] Fix parsing of xmllint --maxmem option
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix parsing of xmllint --maxmem option
- Date: Tue, 1 Feb 2022 15:38:49 +0000 (UTC)
commit 247cfa27ccaa50421b4e127dd6ea13aa5fe59549
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Tue Feb 1 16:21:10 2022 +0100
Fix parsing of xmllint --maxmem option
Fixes #195.
xmllint.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/xmllint.c b/xmllint.c
index ae70a68d..24768bc9 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -3189,14 +3189,13 @@ main(int argc, char **argv) {
if ((!strcmp(argv[i], "-maxmem")) ||
(!strcmp(argv[i], "--maxmem"))) {
i++;
- if (sscanf(argv[i], "%d", &maxmem) == 1) {
- xmlMemSetup(myFreeFunc, myMallocFunc, myReallocFunc,
- myStrdupFunc);
- } else {
+ if ((i >= argc) || (sscanf(argv[i], "%d", &maxmem) != 1)) {
maxmem = 0;
}
}
}
+ if (maxmem != 0)
+ xmlMemSetup(myFreeFunc, myMallocFunc, myReallocFunc, myStrdupFunc);
LIBXML_TEST_VERSION
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]