]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Fix a typo in a variable name that made pw(8) coredump when using
authorJoerg Wunsch <joerg@FreeBSD.org>
Tue, 21 Aug 2001 10:29:01 +0000 (10:29 +0000)
committerJoerg Wunsch <joerg@FreeBSD.org>
Tue, 21 Aug 2001 10:29:01 +0000 (10:29 +0000)
USE_MD5RAND.

MFC after: 2 days

pw/pw_user.c

index 8a096687e9171eb08a23cec0c21382b9d607bade..9d00bfa0c354b9f99776fa9e88acf0c97547f50e 100644 (file)
@@ -1046,7 +1046,7 @@ pw_getrand(u_char *buf, int len)  /* cryptographically secure rng */
                        MD5Update (&md5_ctx, (u_char*)&tv, sizeof tv);
                } while (n++<20 || tv.tv_usec-tvo.tv_usec<100*1000);
                MD5Final (ubuf, &md5_ctx);
-               memcpy(buf+i, ubuf, MIN(16, len-n));
+               memcpy(buf+i, ubuf, MIN(16, len-i));
        }
        return buf;
 }