r8795: fix our perpetual motion maching in strncpy_w()
authorGerald Carter <jerry@samba.org>
Wed, 27 Jul 2005 14:21:27 +0000 (14:21 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:00:17 +0000 (11:00 -0500)
(This used to be commit 3228e93ef2beda6f3551b2630e48db18bafd2e20)

source3/lib/util_unistr.c

index 8ae86a7c612287db0d1c152a68ad34ebfb727a5d..b31e01474a8b44362b8a79292115f3a3bf2f50fd 100644 (file)
@@ -697,7 +697,7 @@ smb_ucs2_t *strncpy_w(smb_ucs2_t *dest, const smb_ucs2_t *src, const size_t max)
                cp = *COPY_UCS2_CHAR(dest+len,src+len);
        }
        cp = 0;
-       while (len < max) {
+       for ( /*nothing*/ ; len < max; len++ ) {
                cp = *COPY_UCS2_CHAR(dest+len,&cp);
        }