X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Flib.c;h=c1e2807ec23164a73f566c40506f04aa238a782c;hb=ec0a3c65da8c3d47895ab2e5b4cec8cf2070f6eb;hp=369b7b0b8593848ffd3523d8fcd03bc2707c697f;hpb=c0a6af0e8c4840c370e819cd44925502fae8c4ba;p=tpg%2Facess2.git diff --git a/Kernel/lib.c b/Kernel/lib.c index 369b7b0b..c1e2807e 100644 --- a/Kernel/lib.c +++ b/Kernel/lib.c @@ -490,11 +490,11 @@ char *strcpy(char *__str1, const char *__str2) * \brief Copy a string to a new location * \note Copies at most `max` chars */ -char *strncpy(char *__str1, const char *__str2, size_t max) +char *strncpy(char *__str1, const char *__str2, size_t __max) { - while(*__str2 && max-- >= 1) + while(*__str2 && __max-- >= 1) *__str1++ = *__str2++; - if(max) + if(__max) *__str1 = '\0'; // Terminate String return __str1; }