vm: fix failed alloc condition
[minix.git] / lib / libcrypt / util.c
blobb8d85809ee7385c5c7173ae2eac84bcf1f78ea6a
1 #include <sys/cdefs.h>
2 #if !defined(lint)
3 __RCSID("$NetBSD: util.c,v 1.1 2004/07/02 00:05:23 sjg Exp $");
4 #endif /* not lint */
6 #include <sys/types.h>
8 #include "crypt.h"
10 static const unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
11 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
13 void
14 __crypt_to64(char *s, u_int32_t v, int n)
17 while (--n >= 0) {
18 *s++ = itoa64[v & 0x3f];
19 v >>= 6;