gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 64/173: addrinfo: fix compiler warning on offsetof(


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 64/173: addrinfo: fix compiler warning on offsetof() use
Date: Fri, 24 Feb 2017 14:01:26 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.53.1
in repository gnurl.

commit 6e12bb7cbeda99be8a9c2aace18180784b6b7e26
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Jan 13 23:58:22 2017 +0100

    addrinfo: fix compiler warning on offsetof() use
    
    curl_addrinfo.c:519:20: error: conversion to ‘curl_socklen_t {aka
    unsigned int}’ from ‘long unsigned int’ may alter its value
    [-Werror=conversion]
    
    Follow-up to 1d786faee1046f
---
 lib/curl_addrinfo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c
index 7182a0066..3dbfb3ebf 100644
--- a/lib/curl_addrinfo.c
+++ b/lib/curl_addrinfo.c
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -516,7 +516,8 @@ Curl_addrinfo *Curl_unix2addr(const char *path, bool 
*longpath, bool abstract)
 
   ai->ai_family = AF_UNIX;
   ai->ai_socktype = SOCK_STREAM; /* assume reliable transport for HTTP */
-  ai->ai_addrlen = offsetof(struct sockaddr_un, sun_path) + path_len;
+  ai->ai_addrlen = (curl_socklen_t)
+    ((offsetof(struct sockaddr_un, sun_path) + path_len) & 0x7FFFFFFF);
 
   /* Abstract Unix domain socket have NULL prefix instead of suffix */
   if(abstract)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]