From 616c30ad6768991eab4e187ad630ccbbf91ce388 Mon Sep 17 00:00:00 2001 From: Emil Engler Date: Wed, 26 Aug 2020 21:39:21 +0200 Subject: lib: make Curl_gethostname accept a const pointer The address of that variable never gets changed, only the data in it so why not make it a "char * const"? Closes #5866 --- lib/curl_gethostname.c | 4 ++-- lib/curl_gethostname.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c index 8337c72e8..5f1c9998f 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -48,7 +48,7 @@ * For libcurl static library release builds no overriding takes place. */ -int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) +int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen) { #ifndef HAVE_GETHOSTNAME diff --git a/lib/curl_gethostname.h b/lib/curl_gethostname.h index 8ae15e6c1..2d78bc54d 100644 --- a/lib/curl_gethostname.h +++ b/lib/curl_gethostname.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -26,6 +26,6 @@ #define HOSTNAME_MAX 1024 /* This returns the local machine's un-qualified hostname */ -int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen); +int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen); #endif /* HEADER_CURL_GETHOSTNAME_H */ -- cgit v1.2.1