From 85db2023cb033928a190ac7fa6f05b5d6cbad14a Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Sat, 2 Jun 2007 20:19:40 +0000 Subject: * Displaying op names instead of numbers in script engine errors. * Fixed a bug introduced in the last rework of the fame ranking. * Created safestrncpy that ensures the string is nul-terminated. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10667 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/strlib.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/common/strlib.h') diff --git a/src/common/strlib.h b/src/common/strlib.h index a3753b918..42fb75ab2 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -4,7 +4,9 @@ #ifndef _STRLIB_H_ #define _STRLIB_H_ -#include // size_t +#ifndef _CBASETYPES_H_ +#include "../common/cbasetypes.h" +#endif char* jstrescape (char* pt); char* jstrescapecpy (char* pt, const char* spt); @@ -15,7 +17,7 @@ char* trim(char* str); char* normalize_name(char* str,const char* delims); const char *stristr(const char *haystack, const char *needle); -#ifdef __WIN32 +#ifdef WIN32 #define HAVE_STRTOK_R #define strtok_r(s,delim,save_ptr) _strtok_r((s),(delim),(save_ptr)) char* _strtok_r(char* s1, const char* s2, char** lasts); @@ -28,4 +30,7 @@ size_t strnlen (const char* string, size_t maxlen); int e_mail_check(char* email); int config_switch(const char* str); +/// always nul-terminates the string +char* safestrncpy(char* dst, const char* src, size_t n); + #endif /* _STRLIB_H_ */ -- cgit v1.2.3-70-g09d2