This corrects what appears to be logic errors in cut_crlf().
I assume that the intention of this function is to truncate a
string at the first cr or lf. However, currently lf are ignored.

If the current logic is intended then it may be simplified as:

        while (*s != '\r') {

Cc: Krzysztof Piotr Oledzki <o...@ans.pl>
Signed-off-by: Simon Horman <ho...@verge.net.au>
---
 include/common/standard.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/common/standard.h b/include/common/standard.h
index b1db821..d931925 100644
--- a/include/common/standard.h
+++ b/include/common/standard.h
@@ -411,7 +411,7 @@ unsigned int inetaddr_host_lim_ret(char *text, char *stop, 
char **ret);
 
 static inline char *cut_crlf(char *s) {
 
-       while (*s != '\r' || *s == '\n') {
+       while (*s != '\r' && *s != '\n') {
                char *p = s++;
 
                if (!*p)
-- 
1.7.10.4


Reply via email to