about summary refs log tree commit diff
path: root/format
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2025-02-17 14:31:43 +0100
committerAlexey Yerin <yyp@disroot.org>2025-02-17 17:03:26 +0300
commita53329a66b255684a92374c417f5612988293e1b (patch)
tree54c7f00db09478b4818f4155b2d1e97a6d49f333 /format
parente5d712e6185dd807728de5e8887042e2b8ea8fd0 (diff)
all: updates for nomem upstream
Diffstat (limited to 'format')
-rw-r--r--format/fastxml/parser.ha4
-rw-r--r--format/fastxml/types.ha2
2 files changed, 3 insertions, 3 deletions
diff --git a/format/fastxml/parser.ha b/format/fastxml/parser.ha
index 5dc1b52..e1573f2 100644
--- a/format/fastxml/parser.ha
+++ b/format/fastxml/parser.ha
@@ -39,7 +39,7 @@ export fn parse(in: io::file) (*parser | error) = {
 		textbuf = memio::dynamic(),
 		line = 1,
 		...
-	});
+	})?;
 	match (prolog(par)) {
 	case void => void;
 	case let err: error =>
@@ -308,7 +308,7 @@ fn scan_element(par: *parser) (token | error) = {
 		poptag(par, name)?;
 		return name: elementend;
 	} else {
-		append(par.tags, strings::dup(name));
+		append(par.tags, strings::dup(name)?)?;
 		return name: elementstart;
 	};
 };
diff --git a/format/fastxml/types.ha b/format/fastxml/types.ha
index 8dcf785..f998a97 100644
--- a/format/fastxml/types.ha
+++ b/format/fastxml/types.ha
@@ -49,7 +49,7 @@ export type token = (elementstart | elementend | attribute | text);
 export type syntaxerr = !size;
 
 // Any error which can occur during XML parsing.
-export type error = !(syntaxerr | utf8::invalid | io::error | errors::error);
+export type error = !(syntaxerr | utf8::invalid | io::error | errors::error | nomem);
 
 // Converts an [[error]] to a user-friendly string representation.
 export fn strerror(err: error) const str = {