summaryrefslogtreecommitdiff
path: root/src/client/ClientRead.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-07 15:15:56 +0200
committerMax Kellermann <max@duempel.org>2014-08-07 16:08:02 +0200
commit59d38f876a22ef520c6b897a356e8fb8677481aa (patch)
treeac97bf3dfa23a4ae30a1d76375493f8815c649ff /src/client/ClientRead.cxx
parent5c5c6a965cc3af4c8e725c7c9cc377e80f728279 (diff)
util/StringUtil: add StripRight() overload with "end" argument
Diffstat (limited to 'src/client/ClientRead.cxx')
-rw-r--r--src/client/ClientRead.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/ClientRead.cxx b/src/client/ClientRead.cxx
index ae8eda8bb..9cfb1271f 100644
--- a/src/client/ClientRead.cxx
+++ b/src/client/ClientRead.cxx
@@ -22,7 +22,7 @@
#include "Partition.hxx"
#include "Instance.hxx"
#include "event/Loop.hxx"
-#include "util/CharUtil.hxx"
+#include "util/StringUtil.hxx"
#include <string.h>
@@ -39,11 +39,10 @@ Client::OnSocketInput(void *data, size_t length)
BufferedSocket::ConsumeInput(newline + 1 - p);
/* skip whitespace at the end of the line */
- while (newline > p && IsWhitespaceFast(newline[-1]))
- --newline;
+ char *end = StripRight(p, newline);
/* terminate the string at the end of the line */
- *newline = 0;
+ *end = 0;
CommandResult result = client_process_line(*this, p);
switch (result) {