}
while (1) {
-#if defined _WINDOWS && _MSC_VER < 1900 /* 1900 == VS2015 has real snprintf */
+#if defined _WINDOWS && !defined __WINE__ && _MSC_VER < 1900 /* 1900 == VS2015 has real snprintf */
#define vsnprintf _vsnprintf
#endif
#ifdef va_copy
if (*datalen < 4)
return NULL;
len = GET_32BIT_MSB_FIRST((const unsigned char *)*data);
- if (*datalen < len+4)
+ if (*datalen - 4 < len)
return NULL;
ret = (void *)((const char *)*data + 4);
*datalen -= len + 4;
char *buildinfo(const char *newline)
{
strbuf *buf = strbuf_new();
+ extern const char commitid[]; /* in commitid.c */
strbuf_catf(buf, "Build platform: %d-bit %s",
(int)(CHAR_BIT * sizeof(void *)),
strbuf_catf(buf, "%sBuild option: DEBUG", newline);
#endif
+ strbuf_catf(buf, "%sSource commit: %s", newline, commitid);
+
return strbuf_to_str(buf);
}