shithub: choc

Download patch

ref: b4701b6c91a46f7818958bbb3ace85a41341ee43
parent: bad402578da34451e9a228d913817d0e6b3a532b
author: Alex Mayfield <alexmax2742@gmail.com>
date: Thu Mar 9 13:09:25 EST 2017

Improve version mismatch error

The error message now spells out the entire client and server version
string, so they can be visually inspected for discrepancies.

--- a/midiproc/main.c
+++ b/midiproc/main.c
@@ -398,10 +398,16 @@
     // Make sure our Choccolate Doom and midiproc version are lined up.
     if (strcmp(PACKAGE_STRING, argv[1]) != 0)
     {
-        MessageBox(NULL, TEXT("It appears that the version of ")
-            TEXT(PACKAGE_NAME) TEXT(" and ") TEXT(PROGRAM_PREFIX)
-            TEXT("midiproc are out of sync.  Please reinstall ")
-            TEXT(PACKAGE_NAME) TEXT("."),
+        char message[1024];
+        snprintf(message, sizeof(message),
+            "It appears that the version of %s and %smidiproc are out of "
+            " sync.  Please reinstall %s.\r\n\r\n"
+            "Server Version: %s\r\nClient Version: %s",
+            PACKAGE_NAME, PROGRAM_PREFIX, PACKAGE_NAME,
+            PACKAGE_STRING, argv[1]);
+        message[sizeof(message) - 1] = '\0';
+
+        MessageBox(NULL, TEXT(message),
             TEXT(PACKAGE_STRING), MB_OK | MB_ICONASTERISK);
 
         return EXIT_FAILURE;