Skip to content
Snippets Groups Projects
Commit cea8e39b authored by Steven Murray's avatar Steven Murray Committed by Steven Murray
Browse files

Fixed a bug in sstrerror()

I introduced a bug into sstrerror() when I added error checking code
around the call to Cglobals_get().  The hash of the offending commit is:

ff8021a2

Before my so say improvements, the return value of Cglobals_get() was
not checked.  I added a check that assumed an error had occured if the
return value was non-zero.  Unfortuntaley for me, the return values 0
and 1 both mean success.  A return value of -1 signifies a failure.
parent cb9cfa22
No related branches found
No related tags found
No related merge requests found
......@@ -626,7 +626,7 @@ const char *sstrerror(const int n) {
void *buf = NULL;
int buflen = 80;
if(Cglobals_get(&sstrerror_key, &buf, buflen)) {
if(0 > Cglobals_get(&sstrerror_key, &buf, buflen)) {
return "Unknown error"
": No thread specific memory for error string"
": Cglobals_get() failed";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment