diff options
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/errno.h | 8 | ||||
-rw-r--r-- | pjlib/src/pj/errno.c | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h index 5744a754..03440c2a 100644 --- a/pjlib/include/pj/errno.h +++ b/pjlib/include/pj/errno.h @@ -287,9 +287,15 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code, #define PJ_ETOOBIG (PJ_ERRNO_START_STATUS + 17)/* 70017 */ /** * @hideinitializer - * Error in gethostbyname() + * Error in gethostbyname(). This is a generic error returned when + * gethostbyname() has returned an error. */ #define PJ_ERESOLVE (PJ_ERRNO_START_STATUS + 18)/* 70018 */ +/** + * @hideinitializer + * Size is too small. + */ +#define PJ_ETOOSMALL (PJ_ERRNO_START_STATUS + 19)/* 70019 */ /** @} */ /* pj_errnum */ diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c index b3a9b329..1d7767f4 100644 --- a/pjlib/src/pj/errno.c +++ b/pjlib/src/pj/errno.c @@ -65,6 +65,7 @@ static const struct PJ_BUILD_ERR(PJ_EEOF, "End of file" ), PJ_BUILD_ERR(PJ_ETOOBIG, "Size is too big"), PJ_BUILD_ERR(PJ_ERESOLVE, "gethostbyname() has returned error"), + PJ_BUILD_ERR(PJ_ETOOSMALL, "Size is too short"), }; #endif /* PJ_HAS_ERROR_STRING */ @@ -161,6 +162,9 @@ PJ_DEF(pj_str_t) pj_strerror( pj_status_t statcode, return (*err_msg_hnd[i].strerror)(statcode, buf, bufsize); } } + + /* Handler not found! */ + len = pj_ansi_snprintf( buf, bufsize, "Unknown error %d", statcode); } if (len < 1) { |