]> granicus.if.org Git - nethack/commitdiff
win32 error message glitch noticed
authornethack.allison <nethack.allison>
Sat, 15 Feb 2003 15:46:58 +0000 (15:46 +0000)
committernethack.allison <nethack.allison>
Sat, 15 Feb 2003 15:46:58 +0000 (15:46 +0000)
sys/share/pcunix.c

index 4a26eec68059361e4cfa13dac421e9243a6d6cee..7cd6b585380d1b16307684ee438fc0d2016d3352 100644 (file)
@@ -127,11 +127,16 @@ getlock()
 # if defined(WIN32)
 #  if defined(HOLD_LOCKFILE_OPEN)
                if(errno == EACCES) {
-                       msmsg("\nThere are files from a game in progress under your name.");
-                       msmsg(
-               "\nThe files are locked or inaccessible. Is the other game still running?");
-                       unlock_file(HLOCK);
-                       error("Cannot open %s", fq_lock);
+#define OOPS_BUFSZ 512
+                   char oops[OOPS_BUFSZ];
+                   Strcpy(oops,
+                            "\nThere are files from a game in progress under your name.");
+                   Strcat(oops, "\nThe files are locked or inaccessible.");
+                   Strcat(oops, " Is the other game still running?\n");
+                   if (strlen(fq_lock) < ((OOPS_BUFSZ - 1) - strlen(oops)))
+                           Sprintf(eos(oops), "Cannot open %s", fq_lock);
+                   unlock_file(HLOCK);
+                   error(oops);
                } else
 #  endif
                error("Bad directory or name: %s\n%s\n",