Skip to content

Refactor: libcrmcommon: New append_xml_escaped_fn_t - #4160

Open
nrwahl2 wants to merge 1 commit into
ClusterLabs:mainfrom
nrwahl2:nrwahl2-acls_demo
Open

Refactor: libcrmcommon: New append_xml_escaped_fn_t#4160
nrwahl2 wants to merge 1 commit into
ClusterLabs:mainfrom
nrwahl2:nrwahl2-acls_demo

Conversation

@nrwahl2

@nrwahl2 nrwahl2 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@nrwahl2
nrwahl2 requested a review from clumens August 8, 2026 04:39
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
@nrwahl2
nrwahl2 force-pushed the nrwahl2-acls_demo branch from c6599ed to d70ade5 Compare August 8, 2026 08:09
Comment thread lib/common/xml.c
append_xml_escaped_fn_t append_char_fn = NULL;
GString *copy = NULL;

pcmk__assert((type >= 0) && (type <= pcmk__xml_escape_attr_pretty));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm already on the fence about merging this -- clarity and brevity are about the same before and after. And here, for this bounds check, we assume that pcmk__xml_escape_attr_pretty is the maximum enum value. That's true right now and probably will be forever. But semantically there's no reason pcmk__xml_escape_attr_pretty should be greater than pcmk__xml_escape_text or pcmk__xml_escape_attr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant