Migrate last strings

FossilOrigin-Name: b81e2948d74e606b374ad69956719d748340eb128dc5e4c732781a2de71c2ba2
This commit is contained in:
Jonathan Schleifer 2025-03-15 23:42:51 +00:00
parent 71fff6f9a1
commit 9dff5ec70c
6 changed files with 76 additions and 69 deletions

View file

@ -55,31 +55,6 @@ typedef unsigned int uint;
# define _vsnprintf vsnprintf
#endif
// easy safe strings
#define _MAXDEFSTR 260
typedef char string[_MAXDEFSTR];
inline void
strn0cpy(char *d, const char *s, size_t m)
{
strncpy(d, s, m);
d[(m)-1] = 0;
}
inline void
strcpy_s(char *d, const char *s)
{
strn0cpy(d, s, _MAXDEFSTR);
}
inline void
strcat_s(char *d, const char *s)
{
size_t n = strlen(d);
strn0cpy(d + n, s, _MAXDEFSTR - n);
}
#define fast_f2nat(val) ((int)(val))
extern void endianswap(void *, int, int);