summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2008-02-04 21:49:35 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2008-02-04 21:49:35 (GMT)
commit77757c8d84e0fdde04be923c8a7f3ea8cd7bcf39 (patch) (side-by-side diff)
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
Diffstat (more/less context) (ignore whitespace changes)
-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 e547c40..0335e49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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>
* src/symtab.c: Ported r1584 from branches/gmach.
diff --git a/configure.ac b/configure.ac
index 056f46d..5972335 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,7 +47,7 @@ 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.
AC_TYPE_SIGNAL
diff --git a/gacopyz/server.c b/gacopyz/server.c
index a4a05e4..1c1f108 100644
--- a/gacopyz/server.c
+++ b/gacopyz/server.c
@@ -1,5 +1,5 @@
/* 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
it under the terms of the GNU General Public License as published by
@@ -119,7 +119,6 @@ void
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)
return;
@@ -298,7 +297,6 @@ int
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));
if (!srv)
@@ -804,7 +802,6 @@ gacopyz_srv_connect(gacopyz_srv_t srv)
char *proto;
char *port;
char *path;
- int rc;
GACOPYZ_ASSERT(srv);
diff --git a/src/bi_db.m4 b/src/bi_db.m4
index bb0b9f4..f366008 100644
--- a/src/bi_db.m4
+++ b/src/bi_db.m4
@@ -1,5 +1,5 @@
-/* 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
it under the terms of the GNU General Public License as published by
@@ -137,7 +137,7 @@ MF_DEFUN(dbdel, VOID, STRING dbname, STRING keystr, OPTIONAL, NUMBER null)
MF_ASSERT(rc == 0,
mf_dbfailure,
_("Failed to delete data `%s' from `%s': %s"),
- key,
+ keystr,
dbname,
mu_dbm_strerror());
}
@@ -238,9 +238,10 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
memcpy(MU_DATUM_PTR(contents),
&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());
} else
@@ -259,9 +260,9 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
MU_DATUM_PTR(contents) = (void*)&now;
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());
rc = 1;
diff --git a/src/bi_sprintf.m4 b/src/bi_sprintf.m4
index 3f3f434..afd63d3 100644
--- a/src/bi_sprintf.m4
+++ b/src/bi_sprintf.m4
@@ -1,5 +1,5 @@
-/* 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
it under the terms of the GNU General Public License as published by
@@ -376,7 +376,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
/* A - overrides a 0 if both are given.*/
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);
if (prec && prec > n) {
diff --git a/src/db.c b/src/db.c
index d8efaa6..4ab865d 100644
--- a/src/db.c
+++ b/src/db.c
@@ -1,5 +1,5 @@
-/* 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
it under the terms of the GNU General Public License as published by
@@ -128,7 +128,7 @@ db_enumerate(DBM_FILE *db, db_enum_func fun, void *data)
} else {
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());
rc = 1;
@@ -327,7 +327,7 @@ db_compact_func(DBM_DATUM key, DBM_DATUM contents, void *data)
} else if (mu_dbm_insert(&dp->ndb, key, contents, 1)) {
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());
dp->rc = 1;
diff --git a/src/engine.c b/src/engine.c
index a2b26f5..b40e75e 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -1285,7 +1285,7 @@ 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 6efb0e8..416916b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,5 @@
/* 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
it under the terms of the GNU General Public License as published by
@@ -33,6 +33,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
#include <mailutils/mailutils.h>
#if MAILUTILS_VERSION_NUMBER < 1290
diff --git a/src/mtasim.c b/src/mtasim.c
index 2a12a43..8940b7a 100644
--- a/src/mtasim.c
+++ b/src/mtasim.c
@@ -1,6 +1,6 @@
/*
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
it under the terms of the GNU General Public License as published by
@@ -36,6 +36,9 @@
# include <readline/readline.h>
# include <readline/history.h>
#endif
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
#include <pwd.h>
#include <sys/stat.h>
diff --git a/src/prog.c b/src/prog.c
index 4d9724c..abb9ce8 100644
--- a/src/prog.c
+++ b/src/prog.c
@@ -1,5 +1,5 @@
/* 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
it under the terms of the GNU General Public License as published by
@@ -410,12 +410,12 @@ 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);
}
@@ -1087,7 +1087,7 @@ instr_div(eval_environ_t env)
prog_trace(env, "DIV %ld %ld", a, b);
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.