Commit 5c5c6a96 authored by Max Kellermann's avatar Max Kellermann

LogBackend: use StripRight()

Eliminate duplicate code.
parent 74aafe6a
......@@ -1796,6 +1796,7 @@ test_run_avahi_CPPFLAGS = $(AM_CPPFLAGS) \
test_run_avahi_LDADD = \
libevent.a \
libsystem.a \
libutil.a \
$(GLIB_LIBS) \
$(AVAHI_LIBS)
......@@ -1928,6 +1929,7 @@ test_test_mixramp_SOURCES = \
test_test_mixramp_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS) -DCPPUNIT_HAVE_RTTI=0
test_test_mixramp_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_mixramp_LDADD = \
libutil.a \
$(GLIB_LIBS) \
$(CPPUNIT_LIBS)
......@@ -1970,6 +1972,7 @@ test_test_archive_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS) -DCPPUNIT_HAVE_RTT
test_test_archive_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_archive_LDADD = \
libarchive.a \
libutil.a \
$(GLIB_LIBS) \
$(CPPUNIT_LIBS)
......
......@@ -21,7 +21,7 @@
#include "LogBackend.hxx"
#include "Log.hxx"
#include "util/Domain.hxx"
#include "util/CharUtil.hxx"
#include "util/StringUtil.hxx"
#ifdef HAVE_GLIB
#include <glib.h>
......@@ -119,11 +119,7 @@ static int
chomp_length(const char *p)
{
size_t length = strlen(p);
while (length > 0 && IsWhitespaceFast(p[length - 1]))
--length;
return (int)length;
return StripRight(p, length);
}
#ifdef HAVE_SYSLOG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment