New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

wants to merge 2 commits into
base: master


None yet
2 participants

skyline75489 commented Jan 2, 2018

No description provided.


This comment has been minimized.


bagder commented Jan 4, 2018

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


This comment has been minimized.


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?


This comment has been minimized.


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.


This comment has been minimized.

skyline75489 commented Jan 15, 2018

@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

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018

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