diff options
author | Linus Nordberg <linus@nordu.net> | 2011-03-08 13:32:10 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2011-03-08 13:32:10 +0100 |
commit | 657eec7ee5a276521eb456bf648878935e794b6e (patch) | |
tree | ef3f4e6a7a1b82eb7da72aca867645474aad8b36 /lib/err.c | |
parent | 1073de4a6139cf1b78ed82bc93e26be385cb76b1 (diff) |
Clean up struct rs_error somewhat.
More to be done here!
Diffstat (limited to 'lib/err.c')
-rw-r--r-- | lib/err.c | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -178,7 +178,9 @@ rs_err_conn_pop (struct rs_connection *conn) int rs_err_conn_peek_code (struct rs_connection *conn) { - if (conn && conn->err) + if (!conn) + return -1; /* FIXME: RSE_INVALID_CONN */ + if (conn->err) return conn->err->code; else return RSE_OK; @@ -188,26 +190,15 @@ void rs_err_free (struct rs_error *err) { assert (err); - if (err->msg) - free (err->msg); free (err); } char * -rs_err_msg (struct rs_error *err, int dofree_flag) +rs_err_msg (struct rs_error *err) { - char *msg; - if (!err) return NULL; - if (err->msg) - msg = err->msg; - else - msg = strdup (err->buf); - - if (dofree_flag) - rs_err_free (err); - return msg; + return err->buf; } int |