projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6cfc85a
)
Cast EOF to get a proper comparison.
author
Justin Hibbits
<jrh29@alumni.cwru.edu>
Thu, 12 Feb 2015 05:31:46 +0000
(
05:31
+0000)
committer
Justin Hibbits
<jrh29@alumni.cwru.edu>
Thu, 12 Feb 2015 05:31:46 +0000
(
05:31
+0000)
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.
llvm-svn: 228909
lldb/source/Host/common/Editline.cpp
patch
|
blob
|
history
diff --git
a/lldb/source/Host/common/Editline.cpp
b/lldb/source/Host/common/Editline.cpp
index
a127d58
..
dd2e2db
100644
(file)
--- a/
lldb/source/Host/common/Editline.cpp
+++ b/
lldb/source/Host/common/Editline.cpp
@@
-594,7
+594,7
@@
Editline::GetCharacter (EditLineCharType * c)
return 1;
#else
*c = ch;
- if(
*c !=
EOF)
+ if(
ch != (char)
EOF)
return 1;
#endif
}