foxygit / doom Log in
commit b4701b6c91a46f7818958bbb3ace85a41341ee43
Author:     Alex Mayfield <alexmax2742@gmail.com>
AuthorDate: Thu Mar 9 18:09:25 2017 -0500
Commit:     Alex Mayfield <alexmax2742@gmail.com>
CommitDate: Thu Mar 9 18:09:25 2017 -0500

    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.
---
 midiproc/main.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/midiproc/main.c b/midiproc/main.c
index 42ffa07d..11ec5eac 100644
--- a/midiproc/main.c
+++ b/midiproc/main.c
@@ -398,10 +398,16 @@ int main(int argc, char *argv[])
     // 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;