mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 08:28:34 +00:00
Replace vim_strncpy calls: add STRLCPY
This commit is contained in:

committed by
Justin M. Keyes

parent
5b3b3fd3ed
commit
f9596aa201
@@ -1,6 +1,5 @@
|
|||||||
// Various routines dealing with allocation and deallocation of memory.
|
// Various routines dealing with allocation and deallocation of memory.
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
#ifndef NVIM_VIM_H
|
#ifndef NVIM_VIM_H
|
||||||
# define NVIM_VIM_H
|
# define NVIM_VIM_H
|
||||||
|
|
||||||
|
#include "nvim/memory.h"// for xstrlcpy
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
|
|
||||||
/* Included when ported to cmake */
|
/* Included when ported to cmake */
|
||||||
@@ -834,6 +835,7 @@ typedef enum {
|
|||||||
#define STRLEN(s) strlen((char *)(s))
|
#define STRLEN(s) strlen((char *)(s))
|
||||||
#define STRCPY(d, s) strcpy((char *)(d), (char *)(s))
|
#define STRCPY(d, s) strcpy((char *)(d), (char *)(s))
|
||||||
#define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n))
|
#define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n))
|
||||||
|
#define STRLCPY(d, s, n) xstrlcpy((char *)(d), (char *)(s), (size_t)(n))
|
||||||
#define STRCMP(d, s) strcmp((char *)(d), (char *)(s))
|
#define STRCMP(d, s) strcmp((char *)(d), (char *)(s))
|
||||||
#define STRNCMP(d, s, n) strncmp((char *)(d), (char *)(s), (size_t)(n))
|
#define STRNCMP(d, s, n) strncmp((char *)(d), (char *)(s), (size_t)(n))
|
||||||
#ifdef HAVE_STRCASECMP
|
#ifdef HAVE_STRCASECMP
|
||||||
|
Reference in New Issue
Block a user