summaryrefslogtreecommitdiff
path: root/ucoolib/intf
diff options
context:
space:
mode:
authorNicolas Schodet2012-12-13 19:42:07 +0100
committerNicolas Schodet2019-10-06 23:29:59 +0200
commitb47365e3003b1d8ff4ec05d3e22cdf0c241864ad (patch)
treea23552b28bed906063b6f9e2060cdb35a3791414 /ucoolib/intf
parent849d164146e36554017732392526edb3793f1f7e (diff)
ucoolib/intf: fix for signed char
When promoting a char to int, if char is signed (which is implementation dependant), there is sign extension. We do not want that.
Diffstat (limited to 'ucoolib/intf')
-rw-r--r--ucoolib/intf/stream.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/ucoolib/intf/stream.cc b/ucoolib/intf/stream.cc
index 8f73925..356936d 100644
--- a/ucoolib/intf/stream.cc
+++ b/ucoolib/intf/stream.cc
@@ -43,7 +43,7 @@ Stream::getc ()
char c;
r = read (&c, 1);
if (r == 1)
- return c;
+ return static_cast<unsigned char> (c);
else
return -1;
}