diff --git a/src/misc1.c b/src/misc1.c
index 996ec7450ac7898858e0607e9fd8ca3bcaa4c336..c4a6015a0d1cf9e6b5d81b594d418e7db286e49d 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -9555,7 +9555,7 @@ uniquefy_paths(gap, pattern)
 	    {
 		STRCPY(path, ".");
 		add_pathsep(path);
-		STRCAT(path, short_name);
+		STRMOVE(path + STRLEN(path), short_name);
 	    }
 	}
 	ui_breakcheck();