From: Michael Tremer Date: Thu, 4 Mar 2021 22:03:21 +0000 (+0000) Subject: _pakfire: Remove the trailing newline before passing to python X-Git-Tag: 0.9.28~1285^2~639 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e6327457a595efbb03ac10f29b66af8dba4e464;p=pakfire.git _pakfire: Remove the trailing newline before passing to python Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/pakfire.c b/src/_pakfire/pakfire.c index dd568bfd7..db2e0761a 100644 --- a/src/_pakfire/pakfire.c +++ b/src/_pakfire/pakfire.c @@ -390,8 +390,12 @@ static int __Pakfire_execute_logging_callback(Pakfire pakfire, void* data, break; } + // Remove the trailing newline + while (line && line[length - 1] == '\n') + length--; + // Create tuple with arguments for the callback function - PyObject* args = Py_BuildValue("(is)", priority, line); + PyObject* args = Py_BuildValue("(is#)", priority, line, length); if (!args) return 1;