mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-26 22:59:38 +03:00
assert fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2278 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
3a1fc8f0ab
commit
c5e21dafb7
10
src/chars.c
10
src/chars.c
@ -268,6 +268,8 @@ int mb_cur_max(void)
|
||||
* length. */
|
||||
char *make_mbchar(unsigned int chr, char *chr_mb, int *chr_mb_len)
|
||||
{
|
||||
assert(chr_mb != NULL && chr_mb_len != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (!ISSET(NO_UTF8)) {
|
||||
*chr_mb_len = wctomb(chr_mb, chr);
|
||||
@ -441,8 +443,6 @@ int nstrcasecmp(const char *s1, const char *s2)
|
||||
/* This function is equivalent to strcasecmp() for multibyte strings. */
|
||||
int mbstrcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (!ISSET(NO_UTF8)) {
|
||||
char *s1_mb = charalloc(mb_cur_max());
|
||||
@ -450,6 +450,8 @@ int mbstrcasecmp(const char *s1, const char *s2)
|
||||
int s1_mb_len, s2_mb_len;
|
||||
wchar_t ws1, ws2;
|
||||
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
|
||||
while (*s1 != '\0' && *s2 != '\0') {
|
||||
s1_mb_len = parse_mbchar(s1, s1_mb
|
||||
#ifdef NANO_WIDE
|
||||
@ -518,8 +520,6 @@ int nstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
* strings. */
|
||||
int mbstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (!ISSET(NO_UTF8)) {
|
||||
char *s1_mb = charalloc(mb_cur_max());
|
||||
@ -527,6 +527,8 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
int s1_mb_len, s2_mb_len;
|
||||
wchar_t ws1, ws2;
|
||||
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
|
||||
while (n > 0 && *s1 != '\0' && *s2 != '\0') {
|
||||
s1_mb_len = parse_mbchar(s1, s1_mb
|
||||
#ifdef NANO_WIDE
|
||||
|
Loading…
Reference in New Issue
Block a user