ITS#10410 lutil_strncopy: fix off by one

This commit is contained in:
Howard Chu 2025-12-01 15:18:54 +00:00
parent afafeaf407
commit a16f196903

View file

@ -399,7 +399,7 @@ lutil_strncopy(
if (!a || !b || n == 0)
return a;
while ((*a++ = *b++) && n-- > 0) ;
while ((*a++ = *b++) && --n > 0) ;
return a-1;
}