diff options
author | Rudolfs Kreicbergs <git-no-reply@zabbix.com> | 2011-05-12 16:47:09 +0400 |
---|---|---|
committer | Rudolfs Kreicbergs <git-no-reply@zabbix.com> | 2011-05-12 16:47:09 +0400 |
commit | 50fae7e152874595bcb94711e23a3716247b68ca (patch) | |
tree | 40e9a6d81008561c0661f1b11e7abfc9e5db55b4 /include/zbxtypes.h | |
parent | c967c035c2b24827b7652f93cb7f3080cb6ec82b (diff) |
- [ZBX-3747] replaced strcpy() and vsnprintf() calls with safer ones and strerror() with zbx_strerror() which also prints the error code
[merged from branches/1.8 r19527]
Diffstat (limited to 'include/zbxtypes.h')
-rw-r--r-- | include/zbxtypes.h | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/include/zbxtypes.h b/include/zbxtypes.h index 6465b95da3c..8f267a2b6c1 100644 --- a/include/zbxtypes.h +++ b/include/zbxtypes.h @@ -40,45 +40,42 @@ #ifdef UNICODE # include <strsafe.h> -# define zbx_wsnprintf StringCchPrintf -# define zbx_strlen wcslen -# define zbx_strchr wcschr -# define zbx_strstr wcsstr -# define zbx_fullpath _wfullpath +# define zbx_wsnprintf StringCchPrintf +# define zbx_strlen wcslen +# define zbx_strchr wcschr +# define zbx_strstr wcsstr +# define zbx_fullpath _wfullpath #else -# define zbx_wsnprintf zbx_snprintf -# define zbx_strlen strlen -# define zbx_strchr strchr -# define zbx_strstr strstr -# define zbx_fullpath _fullpath +# define zbx_wsnprintf zbx_snprintf +# define zbx_strlen strlen +# define zbx_strchr strchr +# define zbx_strstr strstr +# define zbx_fullpath _fullpath #endif #ifndef __UINT64_C # define __UINT64_C(x) x -#endif /* __UINT64_C */ +#endif # define zbx_uint64_t unsigned __int64 # define ZBX_FS_UI64 "%I64u" # define ZBX_FS_UO64 "%I64o" # define ZBX_FS_UX64 "%I64x" -# define zbx_pid_t int - # define stat _stat64 # define snprintf _snprintf -# define vsnprintf _vsnprintf # define alloca _alloca #ifndef uint32_t # define uint32_t __int32 -#endif /* uint32_t */ +#endif #ifndef PATH_SEPARATOR # define PATH_SEPARATOR '\\' -#endif /* PATH_SEPARATOR */ +#endif -#else /* _WINDOWS */ +#else /* _WINDOWS */ # define zbx_stat(path, buf) stat(path, buf) # define zbx_open(pathname, flags) open(pathname, flags) @@ -97,7 +94,7 @@ # define ZBX_FS_UO64 "%lo" # define ZBX_FS_UX64 "%lx" # define ZBX_OFFSET 10000000000000000UL -# else /* __WORDSIZE == 64 */ +# else # ifdef HAVE_LONG_LONG_QU # define ZBX_FS_UI64 "%qu" # define ZBX_FS_UO64 "%qo" @@ -108,15 +105,13 @@ # define ZBX_FS_UX64 "%llx" # endif # define ZBX_OFFSET 10000000000000000ULL -# endif /* __WORDSIZE == 64 */ - -# define zbx_pid_t pid_t +# endif #ifndef PATH_SEPARATOR # define PATH_SEPARATOR '/' #endif -#endif /* _WINDOWS */ +#endif /* _WINDOWS */ #ifndef S_ISREG # define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) |