[Lldb-commits] [lldb] r228909 - Cast EOF to get a proper comparison.
jrh29 at ALUMNI.cwru.edu
Wed Feb 11 21:31:46 PST 2015
Date: Wed Feb 11 23:31:46 2015
New Revision: 228909
Cast EOF to get a proper comparison.
On PowerPC, and maybe some other architectures, 'char' is unsigned. Comparing
an unsigned char with a signed int (-1) is always false. To fix this, down-cast
EOF to a char.
--- lldb/trunk/source/Host/common/Editline.cpp (original)
+++ lldb/trunk/source/Host/common/Editline.cpp Wed Feb 11 23:31:46 2015
@@ -594,7 +594,7 @@ Editline::GetCharacter (EditLineCharType
*c = ch;
- if(*c != EOF)
+ if(ch != (char)EOF)
More information about the lldb-commits