From: Eli Zaretskii Date: Fri, 23 Aug 2019 13:00:25 +0000 (+0300) Subject: Avoid a compilation warning in w32.c X-Git-Tag: emacs-27.0.90~1328^2~95 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b87169d113a151e5d9d6cf7b0d7cb4fb1d3d2d7;p=emacs.git Avoid a compilation warning in w32.c * src/w32.c (logon_network_drive): Avoid compilation warning about strncpy arguments. --- diff --git a/src/w32.c b/src/w32.c index 36a5a37496e..d7a91692c63 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3918,7 +3918,7 @@ logon_network_drive (const char *path) return; n_slashes = 2; - strncpy (share, path, MAX_UTF8_PATH); + strncpy (share, path, MAX_UTF8_PATH - 1); /* Truncate to just server and share name. */ for (p = share + 2; *p && p < share + MAX_UTF8_PATH; p++) {