diff options
Diffstat (limited to 'libtommath/bn_error.c')
-rw-r--r-- | libtommath/bn_error.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/libtommath/bn_error.c b/libtommath/bn_error.c index b1b7177..65906d9 100644 --- a/libtommath/bn_error.c +++ b/libtommath/bn_error.c @@ -16,28 +16,29 @@ */ static const struct { - int code; - char *msg; + int code; + char *msg; } msgs[] = { - { MP_OKAY, "Successful" }, - { MP_MEM, "Out of heap" }, - { MP_VAL, "Value out of range" } + { + MP_OKAY, "Successful"}, { + MP_MEM, "Out of heap"}, { + MP_VAL, "Value out of range"} }; /* return a char * string for a given code */ char *mp_error_to_string(int code) { - int x; + int x; - /* scan the lookup table for the given message */ - for (x = 0; x < (int)(sizeof(msgs) / sizeof(msgs[0])); x++) { - if (msgs[x].code == code) { - return msgs[x].msg; - } - } + /* scan the lookup table for the given message */ + for (x = 0; x < (int)(sizeof(msgs) / sizeof(msgs[0])); x++) { + if (msgs[x].code == code) { + return msgs[x].msg; + } + } - /* generic reply for invalid code */ - return "Invalid error code"; + /* generic reply for invalid code */ + return "Invalid error code"; } #endif |