smb.c: Fixed 'bad suffix on number' on VC6 & 7 #2211

wants to merge 2 commits into


None yet
2 participants

No description provided.


bagder commented Jan 4, 2018

./smb.c:735:2: warning: Trailing whitespace (TRAILINGSPACE)


bagder commented Jan 8, 2018

The function get_posix_time() is a weird one:

First, we should fix the second argument to not use a void pointer and instead pass in a correct type. Then, it seems the second argument is only ever &smb_m->last_change_time and I can't find any code that actually sets the last_change_time struct member to anything, so I can't see how that is ever anything but zero?


bagder commented Jan 15, 2018

How about changing the order of the math?

If we divide with 10 million first, we can deduct a much smaller value that shouldn't need any suffix at all for any compiler?

  timestamp /= 10000000;
  timestamp -= 11644473600;

If my thinking is right, it shouldn't change the net result.

@bagder Anything that suits you. I just want to make it compile 😉

bagder added a commit that referenced this pull request Jan 15, 2018

SMB: fix suffix and variable types
1. don't use "ULL" suffix since unsupported in older MSVC
2. use curl_off_t instead of custom long long ifdefs
3. make get_posix_time() not do unaligned data access

Fixes #2211
Reported-by: Chester Liu

@bagder bagder closed this in 25c40c9 Jan 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment