From 252738c8602263aa20f406c73b0420028f06d3e1 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Thu, 4 Mar 2010 14:11:02 -0500 Subject: Comment on the use of PR_ErrorToString vs static table. --- nsscommon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nsscommon.c') diff --git a/nsscommon.c b/nsscommon.c index ea38ffb0..a317cdd3 100644 --- a/nsscommon.c +++ b/nsscommon.c @@ -34,15 +34,17 @@ nssError (void) /* See if PR_GetError can tell us what the error is. */ errorNumber = PR_GetError (); - fprintf(stderr, "(%d) ", errorNumber); + /* PR_ErrorToString always returns a valid string for errors in this range. */ if (errorNumber >= PR_NSPR_ERROR_BASE && errorNumber <= PR_MAX_ERROR) { fprintf (stderr, "%s\n", PR_ErrorToString(errorNumber, PR_LANGUAGE_EN)); return; } + /* PR_ErrorToString does not handle errors outside the range above, so + we handle them ourselves. */ switch (errorNumber) { default: errorText = "(unknown)"; break; #define NSSYERROR(code,msg) case code: errorText = msg; break -- cgit