mirror of
https://github.com/apache/nuttx.git
synced 2025-12-12 22:05:54 +08:00
Ensure that sethostname null terminates the hostname correctly
commit e1c306f2dd added sethostname using
strncpy. This replaces it with strlcpy and uses sizeof() instead of
re-calculating the buffer size.
Rename size argument for get/sethostname to match the implementation
This commit is contained in:
committed by
Xiang Xiao
parent
fc41bb7f8a
commit
df956b08f2
@@ -386,8 +386,8 @@ FAR int *getopterrp(void); /* Print error message */
|
||||
FAR int *getoptindp(void); /* Index into argv */
|
||||
FAR int *getoptoptp(void); /* Unrecognized option character */
|
||||
|
||||
int gethostname(FAR char *name, size_t size);
|
||||
int sethostname(FAR const char *name, size_t size);
|
||||
int gethostname(FAR char *name, size_t namelen);
|
||||
int sethostname(FAR const char *name, size_t namelen);
|
||||
|
||||
/* Get configurable system variables */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user