summaryrefslogtreecommitdiff
path: root/src/catalog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/catalog.c')
-rw-r--r--src/catalog.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/catalog.c b/src/catalog.c
index 03c400d..8ddfaee 100644
--- a/src/catalog.c
+++ b/src/catalog.c
@@ -31,14 +31,13 @@ i18n_init(void) {
static const int should_overwrite = 0;
if (setenv(NLSPATH_KEY, NLSPATH, should_overwrite)) {
- logerr("setenv(\"%s\", \"%s\", 0): %s\n", NLSPATH_KEY,
- NLSPATH, strerror(errno));
+ logerr("setenv(): %s", strerror(errno));
goto out;
}
catalog_descriptor = catopen(CATALOG_NAME, 0);
if (catalog_descriptor != NULL && catalog_descriptor == (nl_catd)-1) {
- logerr("catopen(\"%s\", 0): %s\n", CATALOG_NAME, strerror(errno));
+ logerr("catopen(): %s", strerror(errno));
catalog_descriptor = NULL;
goto out;
}
@@ -54,7 +53,7 @@ i18n_destroy(void) {
if (catalog_descriptor != NULL) {
if (catclose(catalog_descriptor)) {
- logerr("catclose(...): %s\n", strerror(errno));
+ logerr("catclose(): %s", strerror(errno));
goto out;
}
}
@@ -83,7 +82,7 @@ s(const char* const MSGS[], const int msg_id) {
const char *const ret =
catgets(catalog_descriptor, NL_SETD, msg_id, MSGS[msg_id]);
if (errno) {
- logerr("catgets(%d): %s\n", msg_id, strerror(errno));
+ logerr("catgets(): %s", strerror(errno));
}
return ret;
@@ -100,8 +99,7 @@ s_print_msgs(
for (int i = msg_begin; i <= msg_end; i++) {
if (fprintf(stream, "%s", s(MSGS, i)) < 0) {
- logerr("fprintf(stream, \"%%s\", _(%d)): %s\n", i,
- strerror(errno));
+ logerr("fprintf(): %s", strerror(errno));
goto out;
}
}
@@ -122,29 +120,26 @@ dump_translatable_strings(const char *const MSGS[]) {
for (size_t i = 1; MSGS[i]; i++) {
if (printf("%ld ", i) < 0) {
- logerr("printf(\"%%ld\", %d): %s\n", i);
+ logerr("printf(): %s", strerror(errno));
goto out;
}
for (size_t j = 0; MSGS[i][j]; j++) {
if (MSGS[i][j] == '\n') {
if (printf("\\n") < 0) {
- logerr("printf(\"\\\\n\"): %s\n",
- strerror(errno));
+ logerr("printf(): %s", strerror(errno));
goto out;
}
} else {
if (printf("%c", MSGS[i][j]) < 0) {
- logerr("printf(\"%%c\", "
- "MSGS[%ld][%ld]): %s\n",
- i, j, strerror(errno));
+ logerr("printf(): %s", strerror(errno));
goto out;
}
}
}
if (printf("\n\n") < 0) {
- logerr("printf(\"\\n\\n\"): %s\n", strerror(errno));
+ logerr("printf(): %s", strerror(errno));
goto out;
}
}