aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-02-04 21:49:35 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-02-04 21:49:35 +0000
commit77757c8d84e0fdde04be923c8a7f3ea8cd7bcf39 (patch)
tree63683ad99b6d4ee2ec858255efa14a4b81a07b11
parent6460de7d7ac87145594f28a416f926f830df9b8c (diff)
downloadmailfromd-77757c8d84e0fdde04be923c8a7f3ea8cd7bcf39.tar.gz
mailfromd-77757c8d84e0fdde04be923c8a7f3ea8cd7bcf39.tar.bz2
* configure.ac: Check for locale.h
* src/db.c, src/bi_sprintf.m4, src/prog.c, src/bi_db.m4, src/engine.c: Fix format arguments (ported from branches/gmach@{2008-01-28 and 2008-01-09). * src/main.c, src/mtasim.c: Include locale.h git-svn-id: file:///svnroot/mailfromd/trunk@1603 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac2
-rw-r--r--gacopyz/server.c5
-rw-r--r--src/bi_db.m415
-rw-r--r--src/bi_sprintf.m46
-rw-r--r--src/db.c8
-rw-r--r--src/engine.c2
-rw-r--r--src/main.c5
-rw-r--r--src/mtasim.c5
-rw-r--r--src/prog.c8
10 files changed, 38 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index e547c40e..0335e494 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,2 +1,10 @@
+2008-02-04 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * configure.ac: Check for locale.h
+ * src/db.c, src/bi_sprintf.m4, src/prog.c, src/bi_db.m4,
+ src/engine.c: Fix format arguments (ported from
+ branches/gmach@{2008-01-28 and 2008-01-09).
+ * src/main.c, src/mtasim.c: Include locale.h
+
2008-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
diff --git a/configure.ac b/configure.ac
index 056f46d4..59723359 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,5 +48,5 @@ AC_CHECK_LIB(resolv, res_query)
# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([stdlib.h unistd.h sysexits.h paths.h])
+AC_CHECK_HEADERS([stdlib.h unistd.h sysexits.h paths.h locale.h])
# Checks for typedefs, structures, and compiler characteristics.
diff --git a/gacopyz/server.c b/gacopyz/server.c
index a4a05e49..1c1f1085 100644
--- a/gacopyz/server.c
+++ b/gacopyz/server.c
@@ -1,4 +1,4 @@
/* This file is part of gacopyz.
- Copyright (C) 2007 Sergey Poznyakoff
+ Copyright (C) 2007, 2008 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
@@ -120,5 +120,4 @@ del_def(gacopyz_srv_t srv, const char *name, size_t len)
{
struct gacopyz_macro_def *def = find_def(srv, name, len);
- size_t n;
if (!def)
@@ -299,5 +298,4 @@ gacopyz_srv_create(gacopyz_srv_t *p, const char *name,
const char *portspec, unsigned logmask)
{
- int i;
gacopyz_srv_t srv = calloc(1, sizeof(*srv));
@@ -805,5 +803,4 @@ gacopyz_srv_connect(gacopyz_srv_t srv)
char *port;
char *path;
- int rc;
GACOPYZ_ASSERT(srv);
diff --git a/src/bi_db.m4 b/src/bi_db.m4
index bb0b9f48..f366008f 100644
--- a/src/bi_db.m4
+++ b/src/bi_db.m4
@@ -1,4 +1,4 @@
-/* This file is part of mailfromd. -*- c -*-
- Copyright (C) 2006, 2007 Sergey Poznyakoff
+/* This file is part of Mailfromd. -*- c -*-
+ Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
@@ -138,5 +138,5 @@ MF_DEFUN(dbdel, VOID, STRING dbname, STRING keystr, OPTIONAL, NUMBER null)
mf_dbfailure,
_("Failed to delete data `%s' from `%s': %s"),
- key,
+ keystr,
dbname,
mu_dbm_strerror());
@@ -239,7 +239,8 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
&now, sizeof now);
if (mu_dbm_insert(&db, key, contents, 1))
- mu_error(_("Cannot insert datum `%s' in "
+ mu_error(_("Cannot insert datum `%-.*s' in "
"greylist database %s: %s"),
- key,
+ MU_DATUM_SIZE(key),
+ (char*)MU_DATUM_PTR(key),
greylist_format->dbname,
mu_dbm_strerror());
@@ -260,7 +261,7 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
MU_DATUM_SIZE(contents) = sizeof now;
if (mu_dbm_insert(&db, key, contents, 1))
- mu_error(_("Cannot insert datum `%s' in greylist "
+ mu_error(_("Cannot insert datum `%-.*s' in greylist "
"database %s: %s"),
- key,
+ MU_DATUM_SIZE(key), (char*)MU_DATUM_PTR(key),
greylist_format->dbname,
mu_dbm_strerror());
diff --git a/src/bi_sprintf.m4 b/src/bi_sprintf.m4
index 3f3f434d..afd63d32 100644
--- a/src/bi_sprintf.m4
+++ b/src/bi_sprintf.m4
@@ -1,4 +1,4 @@
-/* This file is part of mailfromd. -*- c -*-
- Copyright (C) 2007 Sergey Poznyakoff
+/* This file is part of Mailfromd. -*- c -*-
+ Copyright (C) 2007, 2008 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
@@ -377,5 +377,5 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
if (prec || (flags & FMT_ADJUST_LEFT))
flags &= ~FMT_PADZERO;
- snprintf(buf+1, sizeof(buf)-1, "%o", num);
+ snprintf(buf+1, sizeof(buf)-1, "%lo", num);
str = buf + 2;
n = strlen(str);
diff --git a/src/db.c b/src/db.c
index d8efaa6f..4ab865da 100644
--- a/src/db.c
+++ b/src/db.c
@@ -1,4 +1,4 @@
-/* This file is part of mailfromd.
- Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff
+/* This file is part of Mailfromd.
+ Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
@@ -129,5 +129,5 @@ db_enumerate(DBM_FILE *db, db_enum_func fun, void *data)
mu_error(_("Cannot fetch data `%*.*s' from `%s': %s"),
MU_DATUM_SIZE(key), MU_DATUM_SIZE(key),
- MU_DATUM_PTR(key),
+ (char*) MU_DATUM_PTR(key),
db->name,
mu_dbm_strerror());
@@ -328,5 +328,5 @@ db_compact_func(DBM_DATUM key, DBM_DATUM contents, void *data)
mu_error(_("Cannot insert datum `%*.*s' into `%s': %s"),
MU_DATUM_SIZE(key), MU_DATUM_SIZE(key),
- MU_DATUM_PTR(key),
+ (char*) MU_DATUM_PTR(key),
dp->ndb.name,
mu_dbm_strerror());
diff --git a/src/engine.c b/src/engine.c
index a2b26f50..b40e75ed 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -1286,5 +1286,5 @@ check_pidfile(char *name)
fclose(fp);
if (unlink(pidfile)) {
- mu_error(_("Cannot unlink pidfile `%s'"),
+ mu_error(_("Cannot unlink pidfile `%s': %s"),
name, mu_strerror(errno));
exit(EX_USAGE);
diff --git a/src/main.c b/src/main.c
index 6efb0e8e..416916b2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,4 +1,4 @@
/* This file is part of mailfromd.
- Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff
+ Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
@@ -34,4 +34,7 @@
#include <arpa/inet.h>
#include <netdb.h>
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
#include <mailutils/mailutils.h>
diff --git a/src/mtasim.c b/src/mtasim.c
index 2a12a436..8940b7a8 100644
--- a/src/mtasim.c
+++ b/src/mtasim.c
@@ -1,5 +1,5 @@
/*
This file is part of Mailfromd.
- Copyright (C) 2003, 2004, 2007 The Anubis Team.
+ Copyright (C) 2003, 2004, 2007, 2008 The Anubis Team.
Mailfromd is free software; you can redistribute it and/or modify
@@ -37,4 +37,7 @@
# include <readline/history.h>
#endif
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
#include <pwd.h>
diff --git a/src/prog.c b/src/prog.c
index 4d9724cf..abb9ce8a 100644
--- a/src/prog.c
+++ b/src/prog.c
@@ -1,4 +1,4 @@
/* This file is part of mailfromd.
- Copyright (C) 2006, 2007 Sergey Poznyakoff
+ Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
@@ -411,10 +411,10 @@ runtime_stack_trace(eval_environ_t env)
if (ploc)
- mu_error("%04d: %s:%lu: %s",
+ mu_error("%04lu: %s:%lu: %s",
(unsigned long) pc,
ploc->file, (unsigned long) ploc->line,
name);
else
- mu_error("%04d: %s",
+ mu_error("%04lu: %s",
(unsigned long) pc,
name);
@@ -1088,5 +1088,5 @@ instr_div(eval_environ_t env)
if (b == 0)
env_throw(env, mf_divzero,
- "Division by zero at %08x", env->pc);
+ "Division by zero at %08lx", (unsigned long)env->pc);
push(env, (STKVAL) (a / b));
}

Return to:

Send suggestions and report system problems to the System administrator.