1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 16:48:49 -05:00

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
This commit is contained in:
Emil Engler 2020-08-26 21:39:21 +02:00 committed by Daniel Stenberg
parent 0da301a082
commit 616c30ad67
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * 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. * 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 #ifndef HAVE_GETHOSTNAME

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -26,6 +26,6 @@
#define HOSTNAME_MAX 1024 #define HOSTNAME_MAX 1024
/* This returns the local machine's un-qualified hostname */ /* 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 */ #endif /* HEADER_CURL_GETHOSTNAME_H */