mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 15:01:40 +00:00
FLUID_STRNCPY: always add terminator '\0'
This commit is contained in:
parent
36f7cc1b21
commit
cd17358b7e
1 changed files with 6 additions and 1 deletions
|
@ -231,7 +231,12 @@ typedef FILE* fluid_file;
|
||||||
#define FLUID_STRCMP(_s,_t) strcmp(_s,_t)
|
#define FLUID_STRCMP(_s,_t) strcmp(_s,_t)
|
||||||
#define FLUID_STRNCMP(_s,_t,_n) strncmp(_s,_t,_n)
|
#define FLUID_STRNCMP(_s,_t,_n) strncmp(_s,_t,_n)
|
||||||
#define FLUID_STRCPY(_dst,_src) strcpy(_dst,_src)
|
#define FLUID_STRCPY(_dst,_src) strcpy(_dst,_src)
|
||||||
#define FLUID_STRNCPY(_dst,_src,_n) strncpy(_dst,_src,_n)
|
|
||||||
|
#define FLUID_STRNCPY(_dst,_src,_n) \
|
||||||
|
do { strncpy(_dst,_src,_n); \
|
||||||
|
(_dst)[(_n)-1]=0; \
|
||||||
|
}while(0)
|
||||||
|
|
||||||
#define FLUID_STRCHR(_s,_c) strchr(_s,_c)
|
#define FLUID_STRCHR(_s,_c) strchr(_s,_c)
|
||||||
#define FLUID_STRRCHR(_s,_c) strrchr(_s,_c)
|
#define FLUID_STRRCHR(_s,_c) strrchr(_s,_c)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue