]> git.wh0rd.org Git - nano.git/commitdiff
fix the previous fix
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Fri, 14 Jan 2005 04:45:18 +0000 (04:45 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Fri, 14 Jan 2005 04:45:18 +0000 (04:45 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2261 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/chars.c

index 2977fd836f60937db23d0096630edb8670ecd2d9..5834e59b0267008ba4fe4f3eb4c7a1b329616f6d 100644 (file)
@@ -159,13 +159,10 @@ size_t mbstrnlen(const char *s, size_t maxlen)
                , NULL);
 
            if (s_mb_len > maxlen)
-               s_mb_len = maxlen;
+               break;
 
            maxlen -= s_mb_len;
            n += s_mb_len;
-
-           if (maxlen == 0)
-               break;
        }
 
        free(s_mb);