From: Lucio Sauer Date: Sun, 2 Jun 2024 23:28:35 +0000 (+0200) Subject: Simplify XML reader error handler X-Git-Tag: 1.6.3~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F137%2Fhead;p=thirdparty%2FFORT-validator.git Simplify XML reader error handler No need to check if ptr[strlen(ptr) - 1] is '\n' because because C strings always end with a null-byte. --- diff --git a/src/xml/relax_ng.c b/src/xml/relax_ng.c index 4470e7d6..d386078a 100644 --- a/src/xml/relax_ng.c +++ b/src/xml/relax_ng.c @@ -38,12 +38,7 @@ relax_ng_log_warn(void *ctx, const char *msg, ...) static void relax_ng_log_str_err(void *userData, const xmlError *error) { - char *ptr; - - ptr = error->message; - if (ptr[strlen(ptr) - 1] == '\n') - ptr[strlen(ptr) - 1] = '\0'; - pr_val_err("%s (at line %d)", ptr, error->line); + pr_val_err("%s (at line %d)", error->message, error->line); } /* Initialize global schema to parse RRDP files */