From 227ba0cb9a5ec44f75d334f2a03d80b120d72fde Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Fri, 6 Jun 2014 20:49:18 +0000 Subject: [PATCH] ICU-10741 Fixed a bug incorrectly processing CR+LF in ucbuf_readline. X-SVN-Rev: 35814 --- icu4c/source/tools/toolutil/ucbuf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/icu4c/source/tools/toolutil/ucbuf.c b/icu4c/source/tools/toolutil/ucbuf.c index 23f2c9f195c..812f78a7339 100644 --- a/icu4c/source/tools/toolutil/ucbuf.c +++ b/icu4c/source/tools/toolutil/ucbuf.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1998-2011, International Business Machines +* Copyright (C) 1998-2014, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -739,7 +739,7 @@ ucbuf_readline(UCHARBUF* buf,int32_t* len,UErrorCode* err){ * CR, CR+LF, LF, NEL, PS, LS or FF as line seperators */ /* Windows CR LF */ - if(c ==0x0d && temp+1<=buf->bufLimit && *(temp+1) == 0x0a ){ + if(c ==0x0d && temp <= buf->bufLimit && *temp == 0x0a ){ *len = (int32_t)(temp++ - buf->currentPos); savePos = buf->currentPos; buf->currentPos = temp; @@ -765,7 +765,7 @@ ucbuf_readline(UCHARBUF* buf,int32_t* len,UErrorCode* err){ return NULL; /* end of file is reached return NULL */ } /* Windows CR LF */ - if(c ==0x0d && temp+1<=buf->bufLimit && *(temp+1) == 0x0a ){ + if(c ==0x0d && temp <= buf->bufLimit && *temp == 0x0a ){ *len = (int32_t)(temp++ - buf->currentPos); savePos = buf->currentPos; buf->currentPos = temp; -- 2.40.0