Check bindtextdomain return value
This commit is contained in:
committed by
Hans Ulrich Niedermann
parent
1ae2edc79b
commit
00b09b0d45
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user