summaryrefslogtreecommitdiff
path: root/lib/telnet.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-12-11 09:15:04 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-12-11 09:15:04 +0100
commit2f5c70b2b0f0fbdc1d0afcc2e148bc3e167ac6c7 (patch)
treed879e5f6b6cbd847294b87dd13a542230092b6d0 /lib/telnet.c
parentf4b5f8cdf0cd68be427c7093fde72f07012c36ca (diff)
downloadcurl-2f5c70b2b0f0fbdc1d0afcc2e148bc3e167ac6c7.tar.gz
telnet: fix "cast increases required alignment of target type"
Diffstat (limited to 'lib/telnet.c')
-rw-r--r--lib/telnet.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/telnet.c b/lib/telnet.c
index b0f72ab0a..176e9940b 100644
--- a/lib/telnet.c
+++ b/lib/telnet.c
@@ -710,7 +710,6 @@ static void printsub(struct SessionHandle *data,
size_t length) /* length of suboption data */
{
unsigned int i = 0;
- unsigned short *pval;
if(data->set.verbose) {
if(direction) {
@@ -763,9 +762,9 @@ static void printsub(struct SessionHandle *data,
switch(pointer[0]) {
case CURL_TELOPT_NAWS:
- pval = (unsigned short*)(pointer+1);
- infof(data, "Width: %hu ; Height: %hu",
- ntohs(pval[0]), ntohs(pval[1]));
+ if(length > 4)
+ infof(data, "Width: %hu ; Height: %hu", (pointer[1]<<8) | pointer[2],
+ (pointer[3]<<8) | pointer[4]);
break;
default:
switch(pointer[1]) {