git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Maven Central in the README
[nikiroo-utils.git]
/
src
/
jexer
/
net
/
TelnetInputStream.java
diff --git
a/src/jexer/net/TelnetInputStream.java
b/src/jexer/net/TelnetInputStream.java
index 056a7dc8e4e10ad2a4d8981f6c1668e1e0422c80..ac010e8f0ab3db06f9c5a038e0ae2464ec209216 100644
(file)
--- a/
src/jexer/net/TelnetInputStream.java
+++ b/
src/jexer/net/TelnetInputStream.java
@@
-926,25
+926,41
@@
public class TelnetInputStream extends InputStream implements SessionInfo {
if (subnegBuffer.get(i) == (byte)TELNET_IAC) {
i++;
}
if (subnegBuffer.get(i) == (byte)TELNET_IAC) {
i++;
}
- windowWidth = subnegBuffer.get(i) * 256;
+ int width = subnegBuffer.get(i);
+ if (width < 0) {
+ width += 256;
+ }
+ windowWidth = width * 256;
i++;
if (subnegBuffer.get(i) == (byte)TELNET_IAC) {
i++;
}
i++;
if (subnegBuffer.get(i) == (byte)TELNET_IAC) {
i++;
}
- windowWidth += subnegBuffer.get(i);
+ width = subnegBuffer.get(i);
+ windowWidth += width;
+ if (width < 0) {
+ windowWidth += 256;
+ }
i++;
if (subnegBuffer.get(i) == (byte)TELNET_IAC) {
i++;
}
i++;
if (subnegBuffer.get(i) == (byte)TELNET_IAC) {
i++;
}
- windowHeight = subnegBuffer.get(i) * 256;
+ int height = subnegBuffer.get(i);
+ if (height < 0) {
+ height += 256;
+ }
+ windowHeight = height * 256;
i++;
if (subnegBuffer.get(i) == (byte)TELNET_IAC) {
i++;
}
i++;
if (subnegBuffer.get(i) == (byte)TELNET_IAC) {
i++;
}
- windowHeight += subnegBuffer.get(i);
+ height = subnegBuffer.get(i);
+ windowHeight += height;
+ if (height < 0) {
+ windowHeight += 256;
+ }
}
break;
}
break;