diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-12-24 00:34:00 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-12-24 00:34:00 -0500 |
commit | 11a3eba72c2a527aab48ba553165e71d6d9507fa (patch) | |
tree | 954ac1472c824b97e75b49cd79e07a05aeda5065 /src | |
parent | aa08632caf80d2259d94e8f6e30cd806e3c05a1d (diff) | |
parent | ed9828140a343145e247a76e175912dcd785899d (diff) | |
download | rneovim-11a3eba72c2a527aab48ba553165e71d6d9507fa.tar.gz rneovim-11a3eba72c2a527aab48ba553165e71d6d9507fa.tar.bz2 rneovim-11a3eba72c2a527aab48ba553165e71d6d9507fa.zip |
Merge #1493: enable linting by default
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/os/fs.c | 3 | ||||
-rw-r--r-- | src/nvim/os/fs_defs.h | 2 | ||||
-rw-r--r-- | src/nvim/os/os_defs.h | 2 | ||||
-rw-r--r-- | src/nvim/os/unix_defs.h | 6 | ||||
-rw-r--r-- | src/nvim/os/users.c | 4 | ||||
-rw-r--r-- | src/nvim/os/win_defs.h | 6 | ||||
-rw-r--r-- | src/nvim/os_unix_defs.h | 6 |
7 files changed, 15 insertions, 14 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index bdaf9ecdda..242f8fb461 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -4,6 +4,7 @@ #include <assert.h> #include "nvim/os/os.h" +#include "nvim/os/os_defs.h" #include "nvim/ascii.h" #include "nvim/memory.h" #include "nvim/message.h" @@ -331,7 +332,7 @@ int os_mkdtemp(const char *template, char *path) uv_fs_t request; int result = uv_fs_mkdtemp(uv_default_loop(), &request, template, NULL); if (result == kLibuvSuccess) { - strcpy(path, request.path); + STRNCPY(path, request.path, TEMP_FILE_PATH_MAXLEN); } uv_fs_req_cleanup(&request); return result; diff --git a/src/nvim/os/fs_defs.h b/src/nvim/os/fs_defs.h index ab4c05b965..e4d79aab66 100644 --- a/src/nvim/os/fs_defs.h +++ b/src/nvim/os/fs_defs.h @@ -14,6 +14,6 @@ typedef struct { uint64_t device_id; ///< @private The id of the device containing the file } FileID; -#define FILE_ID_EMPTY (FileID){.inode = 0, .device_id = 0} +#define FILE_ID_EMPTY (FileID) {.inode = 0, .device_id = 0} #endif // NVIM_OS_FS_DEFS_H diff --git a/src/nvim/os/os_defs.h b/src/nvim/os/os_defs.h index aa6c5bccc3..ec94324df4 100644 --- a/src/nvim/os/os_defs.h +++ b/src/nvim/os/os_defs.h @@ -7,4 +7,4 @@ # include "nvim/os/unix_defs.h" #endif -#endif // NVIM_OS_DEFS_H +#endif // NVIM_OS_OS_DEFS_H diff --git a/src/nvim/os/unix_defs.h b/src/nvim/os/unix_defs.h index 197a87bcc5..e518ac67e5 100644 --- a/src/nvim/os/unix_defs.h +++ b/src/nvim/os/unix_defs.h @@ -1,7 +1,7 @@ -#ifndef NEOVIM_OS_UNIX_DEFS_H -#define NEOVIM_OS_UNIX_DEFS_H +#ifndef NVIM_OS_UNIX_DEFS_H +#define NVIM_OS_UNIX_DEFS_H #define TEMP_DIR_NAMES {"$TMPDIR", "/tmp", ".", "$HOME"} #define TEMP_FILE_PATH_MAXLEN 256 -#endif // NEOVIM_OS_UNIX_DEFS_H +#endif // NVIM_OS_UNIX_DEFS_H diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c index 99479b0bae..a57ba41af1 100644 --- a/src/nvim/os/users.c +++ b/src/nvim/os/users.c @@ -52,7 +52,7 @@ int os_get_uname(uid_t uid, char *s, size_t len) #if defined(HAVE_PWD_H) && defined(HAVE_GETPWUID) struct passwd *pw; - if ((pw = getpwuid(uid)) != NULL + if ((pw = getpwuid(uid)) != NULL // NOLINT(runtime/threadsafe_fn) && pw->pw_name != NULL && *(pw->pw_name) != NUL) { STRLCPY(s, pw->pw_name, len); return OK; @@ -72,7 +72,7 @@ char *os_get_user_directory(const char *name) if (name == NULL) { return NULL; } - pw = getpwnam(name); + pw = getpwnam(name); // NOLINT(runtime/threadsafe_fn) if (pw != NULL) { // save the string from the static passwd entry into malloced memory return xstrdup(pw->pw_dir); diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h index 49fcb64777..bea147ad2d 100644 --- a/src/nvim/os/win_defs.h +++ b/src/nvim/os/win_defs.h @@ -1,9 +1,9 @@ -#ifndef NEOVIM_OS_WIN_DEFS_H -#define NEOVIM_OS_WIN_DEFS_H +#ifndef NVIM_OS_WIN_DEFS_H +#define NVIM_OS_WIN_DEFS_H #include <windows.h> #define TEMP_DIR_NAMES {"$TMP", "$TEMP", "$USERPROFILE", ""} #define TEMP_FILE_PATH_MAXLEN _MAX_PATH -#endif // NEOVIM_OS_WIN_DEFS_H +#endif // NVIM_OS_WIN_DEFS_H diff --git a/src/nvim/os_unix_defs.h b/src/nvim/os_unix_defs.h index ebea86ebcf..adea2ad22f 100644 --- a/src/nvim/os_unix_defs.h +++ b/src/nvim/os_unix_defs.h @@ -1,5 +1,5 @@ -#ifndef NVIM_OS_UNIX_DEFS_H -#define NVIM_OS_UNIX_DEFS_H +#ifndef NVIM_OS_UNIX_DEFS_LEGACY_H +#define NVIM_OS_UNIX_DEFS_LEGACY_H /* * VIM - Vi IMproved by Bram Moolenaar @@ -253,4 +253,4 @@ /* We have three kinds of ACL support. */ #define HAVE_ACL (HAVE_POSIX_ACL || HAVE_SOLARIS_ACL || HAVE_AIX_ACL) -#endif // NVIM_OS_UNIX_DEFS_H +#endif // NVIM_OS_UNIX_DEFS_LEGACY_H |