Skip to content

Commit

Permalink
telnet: fix "cast increases required alignment of target type"
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Dec 11, 2014
1 parent f4b5f8c commit 2f5c70b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/telnet.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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]) {
Expand Down

0 comments on commit 2f5c70b

Please sign in to comment.