]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - misc.c
Remove a redundant ?: in the nethack_keypad code.
[PuTTY.git] / misc.c
diff --git a/misc.c b/misc.c
index 06baf8d6fc6304d9b6f95821cb77c50fc3bf4715..391ea1ba06eb86b7ecefa6e5a598a4447635e600 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -406,7 +406,7 @@ static char *dupvprintf_inner(char *buf, int oldlen, int oldsize,
     }
 
     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
@@ -1118,7 +1118,7 @@ void *get_ssh_string(int *datalen, const void **data, int *stringlen)
     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;
@@ -1151,6 +1151,7 @@ int strendswith(const char *s, const char *t)
 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 *)),
@@ -1207,5 +1208,7 @@ char *buildinfo(const char *newline)
     strbuf_catf(buf, "%sBuild option: DEBUG", newline);
 #endif
 
+    strbuf_catf(buf, "%sSource commit: %s", newline, commitid);
+
     return strbuf_to_str(buf);
 }