From c50925071cce9c6342597f5671e30d2970c6ff4a Mon Sep 17 00:00:00 2001 From: rofl0r Date: Sat, 2 Feb 2013 03:08:57 +0100 Subject: make some arrays const this way they'll go into .rodata, decreasing memory pressure. --- src/crypt/crypt_md5.c | 2 +- src/crypt/crypt_sha256.c | 2 +- src/crypt/crypt_sha512.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/crypt') diff --git a/src/crypt/crypt_md5.c b/src/crypt/crypt_md5.c index 70ab8b99..6e75b36c 100644 --- a/src/crypt/crypt_md5.c +++ b/src/crypt/crypt_md5.c @@ -182,7 +182,7 @@ static void md5_update(struct md5 *s, const void *m, unsigned long len) #define KEY_MAX 30000 #define SALT_MAX 8 -static unsigned char b64[] = +static const unsigned char b64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static char *to64(char *s, unsigned int u, int n) diff --git a/src/crypt/crypt_sha256.c b/src/crypt/crypt_sha256.c index e01a208b..d5f0b786 100644 --- a/src/crypt/crypt_sha256.c +++ b/src/crypt/crypt_sha256.c @@ -153,7 +153,7 @@ static void sha256_update(struct sha256 *s, const void *m, unsigned long len) memcpy(s->buf, p, len); } -static unsigned char b64[] = +static const unsigned char b64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static char *to64(char *s, unsigned int u, int n) diff --git a/src/crypt/crypt_sha512.c b/src/crypt/crypt_sha512.c index 8325d77c..1294e98b 100644 --- a/src/crypt/crypt_sha512.c +++ b/src/crypt/crypt_sha512.c @@ -174,7 +174,7 @@ static void sha512_update(struct sha512 *s, const void *m, unsigned long len) memcpy(s->buf, p, len); } -static unsigned char b64[] = +static const unsigned char b64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static char *to64(char *s, unsigned int u, int n) -- cgit v1.2.3-70-g09d2