From 7fe018e418f1e740303e10cc14689be928aff70d Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 7 Oct 2013 17:32:12 -0500 Subject: [PATCH] libtommath: mp_error_to_string: return const char* instead of char* From https://github.com/libtom/libtommath Change-Id: Idd5cbab380f5d504fece93afb3a5fcc026309482 --- lib/hcrypto/libtommath/bn_error.c | 4 ++-- lib/hcrypto/libtommath/tommath.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/hcrypto/libtommath/bn_error.c b/lib/hcrypto/libtommath/bn_error.c index b1b7177e6..fbba7aa1f 100644 --- a/lib/hcrypto/libtommath/bn_error.c +++ b/lib/hcrypto/libtommath/bn_error.c @@ -17,7 +17,7 @@ static const struct { int code; - char *msg; + const char *msg; } msgs[] = { { MP_OKAY, "Successful" }, { MP_MEM, "Out of heap" }, @@ -25,7 +25,7 @@ static const struct { }; /* return a char * string for a given code */ -char *mp_error_to_string(int code) +const char *mp_error_to_string(int code) { int x; diff --git a/lib/hcrypto/libtommath/tommath.h b/lib/hcrypto/libtommath/tommath.h index 84d3f7a59..0517b22c8 100644 --- a/lib/hcrypto/libtommath/tommath.h +++ b/lib/hcrypto/libtommath/tommath.h @@ -189,8 +189,8 @@ typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat); #define DIGIT(m,k) ((m)->dp[(k)]) #define SIGN(m) ((m)->sign) -/* error code to char* string */ -char *mp_error_to_string(int code); +/* error code to const char* string */ +const char *mp_error_to_string(int code); /* ---> init and deinit bignum functions <--- */ /* init a bignum */ -- 2.11.4.GIT