handle negative error codes

This commit is contained in:
Lennart Poettering 2009-03-04 05:29:09 +01:00
parent 341f44fa24
commit 0dd8a3306f

View file

@ -68,7 +68,10 @@ const char*pa_strerror(int error) {
pa_init_i18n(); pa_init_i18n();
if (error < 0 || error >= PA_ERR_MAX) if (error < 0)
error = -error;
if (error >= PA_ERR_MAX)
return NULL; return NULL;
return _(errortab[error]); return _(errortab[error]);