diff src/channel.c @ 13674:1feeefd8cddb v8.0.1709

patch 8.0.1709: some non-C89 code may slip through commit https://github.com/vim/vim/commit/2e324950b83fcdf60843b54a6a339183370f338a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 14 14:37:07 2018 +0200 patch 8.0.1709: some non-C89 code may slip through Problem: Some non-C89 code may slip through. Solution: Enforce C89 in configure. Fix detected problems. (James McCoy, closes #2735)
author Christian Brabandt <cb@256bit.org>
date Sat, 14 Apr 2018 14:45:06 +0200
parents ab89131d30e0
children f309afff6f25
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -672,9 +672,9 @@ channel_open(
     {
 	char		*p;
 
-	/* When using host->h_addr directly ubsan warns for it to not be
-	 * aligned.  First copy the pointer to aviod that. */
-	memcpy(&p, &host->h_addr, sizeof(p));
+	/* When using host->h_addr_list[0] directly ubsan warns for it to not
+	 * be aligned.  First copy the pointer to avoid that. */
+	memcpy(&p, &host->h_addr_list[0], sizeof(p));
 	memcpy((char *)&server.sin_addr, p, host->h_length);
     }