diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-11-30 18:11:16 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-11-30 18:11:12 +0000 |
commit | 676f79f8d285631fc03eeaf38e0178a138d0499a (patch) | |
tree | 7efaec4b0564e35df7d550f7c69b04b4581bd723 /lib | |
parent | cef28131f7a1d698d8e680aafc96a29033be20d3 (diff) |
smb.c: Fixed compilation warnings
smb.c:311: warning: conversion from 'unsigned __int64' to 'u_short',
possible loss of data
smb.c:425: warning: conversion from '__int64' to 'unsigned short',
possible loss of data
smb.c:452: warning: conversion from '__int64' to 'unsigned short',
possible loss of data
Diffstat (limited to 'lib')
-rw-r--r-- | lib/smb.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -308,7 +308,8 @@ static void smb_format_message(struct connectdata *conn, struct smb_header *h, unsigned int pid; memset(h, 0, sizeof(*h)); - h->nbt_length = htons(sizeof(*h) - sizeof(unsigned int) + len); + h->nbt_length = htons((unsigned short) (sizeof(*h) - sizeof(unsigned int) + + len)); strncpy((char*)h->magic, "\xffSMB", 4); h->command = cmd; h->flags = SMB_FLAGS_CANONICAL_PATHNAMES | SMB_FLAGS_CASELESS_PATHNAMES; @@ -422,7 +423,7 @@ static CURLcode smb_send_setup(struct connectdata *conn) MSGCATNULL(smbc->domain); MSGCATNULL(OS); MSGCATNULL(CLIENTNAME); - setup.byte_count = smb_swap16(p - setup.bytes); + setup.byte_count = smb_swap16((unsigned short) (p - setup.bytes)); return smb_send_message(conn, SMB_COM_SETUP_ANDX, &setup, sizeof(setup) - sizeof(setup.bytes) + @@ -449,7 +450,7 @@ static CURLcode smb_send_tree_connect(struct connectdata *conn) MSGCAT("\\"); MSGCATNULL(req->share); MSGCATNULL(SERVICENAME); /* Match any type of service */ - tree.byte_count = smb_swap16(p - tree.bytes); + tree.byte_count = smb_swap16((unsigned short) (p - tree.bytes)); return smb_send_message(conn, SMB_COM_TREE_CONNECT_ANDX, &tree, sizeof(tree) - sizeof(tree.bytes) + tree.byte_count); |