summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgphoto2/gphoto2-abilities-list.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libgphoto2/gphoto2-abilities-list.c b/libgphoto2/gphoto2-abilities-list.c
index 92d0f2c1c..33776efc8 100644
--- a/libgphoto2/gphoto2-abilities-list.c
+++ b/libgphoto2/gphoto2-abilities-list.c
@@ -26,6 +26,7 @@
#include "config.h"
#include <gphoto2/gphoto2-abilities-list.h>
+#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -85,7 +86,12 @@ gp_init_localedir (const char *localedir)
if (locale_initialised)
return GP_OK;
locale_initialised = 1;
- bindtextdomain (GETTEXT_PACKAGE_LIBGPHOTO2, localedir);
+ if (bindtextdomain (GETTEXT_PACKAGE_LIBGPHOTO2, localedir) == NULL)
+ {
+ if (errno == ENOMEM)
+ return GP_ERROR_NO_MEMORY;
+ return GP_ERROR;
+ }
return GP_OK;
}