aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/error.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpg/error.h')
-rw-r--r--src/gpg/error.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpg/error.h b/src/gpg/error.h
index 990a265..1803cfe 100644
--- a/src/gpg/error.h
+++ b/src/gpg/error.h
@@ -241,8 +241,9 @@ typedef unsigned long gpg_error_t;
static __inline__ gpg_error_t
gpg_make_error (gpg_err_source_t source, gpg_err_code_t code)
{
- return ((source & GPG_ERR_SOURCE_MASK) << GPG_ERR_SOURCE_SHIFT)
- | (code & GPG_ERR_CODE_MASK);
+ return code == GPG_ERR_NO_ERROR ? GPG_ERR_NO_ERROR
+ : (((source & GPG_ERR_SOURCE_MASK) << GPG_ERR_SOURCE_SHIFT)
+ | (code & GPG_ERR_CODE_MASK));
}