fix text handling for wide strinbgs with max length.
This commit is contained in:
5
C/text.c
5
C/text.c
@@ -26,7 +26,10 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifndef HAVE_WCSNLEN
|
||||
#define wcsnlen(S, N) wcslen(S)
|
||||
inline static min(size_t i, size_t j) {
|
||||
i < j ? return i : return j;
|
||||
}
|
||||
#define wcsnlen(S, N) min(N, wcslen(S))
|
||||
#endif
|
||||
|
||||
static inline unsigned char *get_char(unsigned char *p, int *c) { *c = *p; return p+1; }
|
||||
|
Reference in New Issue
Block a user