-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Use of long long type outside of HAVE_LONGLONG ifdef #478
Comments
Thanks, but this patch then assumes we have __int64 if we don't have long long and that too is a bad assumption! |
Hm, but one we do elsewhere in that code already... |
Yes, I assumed it was safe to use since that is the alternative type it uses when HAVE_LONGLONG is not set a few lines up. |
how about this instead?
|
The type change looks good (I'll do a test compile in a minute to confirm), but the ULL on the literal needs to be removed since VC6 doesn't understand that either. |
Oops, you're right. I meant to do that on all of them. |
Patch tested (with ULL removed), compiles fine. Thanks for the extremely fast response. |
thanks for the report, merged fix now! |
As noted in the function, the timestamp is supposed to be a "LE, 64-bit signed value representing the number of tenths of a microsecond since January 1, 1601." Using We either need a type guaranteed at least 64 bits or we have to do something that allows us to represent one like split each of those numbers in two 32bit dwords (this is actually what FILETIME does) and then do the multiplication on them in pieces. I don't really see a reason to do all that at the moment (who else has this problem?) however It may be better to be more explicit about what is required:
Also as you know C89 does not say anything about type representation in numeric literals for decimal past |
Alternatively, as I already merged the change to turn that into using Of course we could also rewrite the logic to not requite 64bit logic, but I'm not sure its worth the effort unless we know we actually have users who'd care.
|
👍 |
Grrr, typo in the commit message for 13ddb9e now refers to the wrong issue. Merged anyway just now! |
... since some compilers don't have it and instead use other types, such as __int64. Reported by: gkinseyhpw Closes curl#478
In lib/curl_ntlm_core.c there is a usage of the "long long" type outside of the ifdef HAVE_LONGLONG which means the code doesn't compile on platforms without "long long".
The following patch fixes it.
Index: curl_ntlm_core.c
--- curl_ntlm_core.c (revision 2295)
+++ curl_ntlm_core.c (revision 2296)
@@ -678,7 +678,11 @@
tw = 11644473600ULL * 10000000ULL;
else
#endif
+#if defined(HAVE_LONGLONG)
tw = ((long long)time(NULL) + 11644473600ULL) * 10000000ULL;
+#else
+#endif
/* Calculate the response len */
len = NTLM_HMAC_MD5_LEN + NTLMv2_BLOB_LEN;
The text was updated successfully, but these errors were encountered: