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) (unidiff)
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 @@
12008-02-04 Sergey Poznyakoff <gray@gnu.org.ua>
2
3 * configure.ac: Check for locale.h
4 * src/db.c, src/bi_sprintf.m4, src/prog.c, src/bi_db.m4,
5 src/engine.c: Fix format arguments (ported from
6 branches/gmach@{2008-01-28 and 2008-01-09).
7 * src/main.c, src/mtasim.c: Include locale.h
8
12008-01-21 Sergey Poznyakoff <gray@gnu.org.ua> 92008-01-21 Sergey Poznyakoff <gray@gnu.org.ua>
2 10
3 * src/symtab.c: Ported r1584 from branches/gmach. 11 * 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)
47 47
48# Checks for header files. 48# Checks for header files.
49AC_HEADER_STDC 49AC_HEADER_STDC
50AC_CHECK_HEADERS([stdlib.h unistd.h sysexits.h paths.h]) 50AC_CHECK_HEADERS([stdlib.h unistd.h sysexits.h paths.h locale.h])
51 51
52# Checks for typedefs, structures, and compiler characteristics. 52# Checks for typedefs, structures, and compiler characteristics.
53AC_TYPE_SIGNAL 53AC_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 @@
1/* This file is part of gacopyz. 1/* This file is part of gacopyz.
2 Copyright (C) 2007 Sergey Poznyakoff 2 Copyright (C) 2007, 2008 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -119,7 +119,6 @@ void
119del_def(gacopyz_srv_t srv, const char *name, size_t len) 119del_def(gacopyz_srv_t srv, const char *name, size_t len)
120{ 120{
121 struct gacopyz_macro_def *def = find_def(srv, name, len); 121 struct gacopyz_macro_def *def = find_def(srv, name, len);
122 size_t n;
123 122
124 if (!def) 123 if (!def)
125 return; 124 return;
@@ -298,7 +297,6 @@ int
298gacopyz_srv_create(gacopyz_srv_t *p, const char *name, 297gacopyz_srv_create(gacopyz_srv_t *p, const char *name,
299 const char *portspec, unsigned logmask) 298 const char *portspec, unsigned logmask)
300{ 299{
301 int i;
302 gacopyz_srv_t srv = calloc(1, sizeof(*srv)); 300 gacopyz_srv_t srv = calloc(1, sizeof(*srv));
303 301
304 if (!srv) 302 if (!srv)
@@ -804,7 +802,6 @@ gacopyz_srv_connect(gacopyz_srv_t srv)
804 char *proto; 802 char *proto;
805 char *port; 803 char *port;
806 char *path; 804 char *path;
807 int rc;
808 805
809 GACOPYZ_ASSERT(srv); 806 GACOPYZ_ASSERT(srv);
810 807
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 @@
1/* This file is part of mailfromd. -*- c -*- 1/* This file is part of Mailfromd. -*- c -*-
2 Copyright (C) 2006, 2007 Sergey Poznyakoff 2 Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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)
137 MF_ASSERT(rc == 0, 137 MF_ASSERT(rc == 0,
138 mf_dbfailure, 138 mf_dbfailure,
139 _("Failed to delete data `%s' from `%s': %s"), 139 _("Failed to delete data `%s' from `%s': %s"),
140 key, 140 keystr,
141 dbname, 141 dbname,
142 mu_dbm_strerror()); 142 mu_dbm_strerror());
143} 143}
@@ -238,9 +238,10 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
238 memcpy(MU_DATUM_PTR(contents), 238 memcpy(MU_DATUM_PTR(contents),
239 &now, sizeof now); 239 &now, sizeof now);
240 if (mu_dbm_insert(&db, key, contents, 1)) 240 if (mu_dbm_insert(&db, key, contents, 1))
241 mu_error(_("Cannot insert datum `%s' in " 241 mu_error(_("Cannot insert datum `%-.*s' in "
242 "greylist database %s: %s"), 242 "greylist database %s: %s"),
243 key, 243 MU_DATUM_SIZE(key),
244 (char*)MU_DATUM_PTR(key),
244 greylist_format->dbname, 245 greylist_format->dbname,
245 mu_dbm_strerror()); 246 mu_dbm_strerror());
246 } else 247 } else
@@ -259,9 +260,9 @@ MF_DEFUN(greylist, NUMBER, STRING email, NUMBER interval)
259 MU_DATUM_PTR(contents) = (void*)&now; 260 MU_DATUM_PTR(contents) = (void*)&now;
260 MU_DATUM_SIZE(contents) = sizeof now; 261 MU_DATUM_SIZE(contents) = sizeof now;
261 if (mu_dbm_insert(&db, key, contents, 1)) 262 if (mu_dbm_insert(&db, key, contents, 1))
262 mu_error(_("Cannot insert datum `%s' in greylist " 263 mu_error(_("Cannot insert datum `%-.*s' in greylist "
263 "database %s: %s"), 264 "database %s: %s"),
264 key, 265 MU_DATUM_SIZE(key), (char*)MU_DATUM_PTR(key),
265 greylist_format->dbname, 266 greylist_format->dbname,
266 mu_dbm_strerror()); 267 mu_dbm_strerror());
267 rc = 1; 268 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 @@
1/* This file is part of mailfromd. -*- c -*- 1/* This file is part of Mailfromd. -*- c -*-
2 Copyright (C) 2007 Sergey Poznyakoff 2 Copyright (C) 2007, 2008 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -376,7 +376,7 @@ MF_DEFUN_VARARGS(sprintf, STRING, STRING format)
376 /* A - overrides a 0 if both are given.*/ 376 /* A - overrides a 0 if both are given.*/
377 if (prec || (flags & FMT_ADJUST_LEFT)) 377 if (prec || (flags & FMT_ADJUST_LEFT))
378 flags &= ~FMT_PADZERO; 378 flags &= ~FMT_PADZERO;
379 snprintf(buf+1, sizeof(buf)-1, "%o", num); 379 snprintf(buf+1, sizeof(buf)-1, "%lo", num);
380 str = buf + 2; 380 str = buf + 2;
381 n = strlen(str); 381 n = strlen(str);
382 if (prec && prec > n) { 382 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 @@
1/* This file is part of mailfromd. 1/* This file is part of Mailfromd.
2 Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff 2 Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 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)
128 } else { 128 } else {
129 mu_error(_("Cannot fetch data `%*.*s' from `%s': %s"), 129 mu_error(_("Cannot fetch data `%*.*s' from `%s': %s"),
130 MU_DATUM_SIZE(key), MU_DATUM_SIZE(key), 130 MU_DATUM_SIZE(key), MU_DATUM_SIZE(key),
131 MU_DATUM_PTR(key), 131 (char*) MU_DATUM_PTR(key),
132 db->name, 132 db->name,
133 mu_dbm_strerror()); 133 mu_dbm_strerror());
134 rc = 1; 134 rc = 1;
@@ -327,7 +327,7 @@ db_compact_func(DBM_DATUM key, DBM_DATUM contents, void *data)
327 } else if (mu_dbm_insert(&dp->ndb, key, contents, 1)) { 327 } else if (mu_dbm_insert(&dp->ndb, key, contents, 1)) {
328 mu_error(_("Cannot insert datum `%*.*s' into `%s': %s"), 328 mu_error(_("Cannot insert datum `%*.*s' into `%s': %s"),
329 MU_DATUM_SIZE(key), MU_DATUM_SIZE(key), 329 MU_DATUM_SIZE(key), MU_DATUM_SIZE(key),
330 MU_DATUM_PTR(key), 330 (char*) MU_DATUM_PTR(key),
331 dp->ndb.name, 331 dp->ndb.name,
332 mu_dbm_strerror()); 332 mu_dbm_strerror());
333 dp->rc = 1; 333 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)
1285 } 1285 }
1286 fclose(fp); 1286 fclose(fp);
1287 if (unlink(pidfile)) { 1287 if (unlink(pidfile)) {
1288 mu_error(_("Cannot unlink pidfile `%s'"), 1288 mu_error(_("Cannot unlink pidfile `%s': %s"),
1289 name, mu_strerror(errno)); 1289 name, mu_strerror(errno));
1290 exit(EX_USAGE); 1290 exit(EX_USAGE);
1291 } 1291 }
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 @@
1/* This file is part of mailfromd. 1/* This file is part of mailfromd.
2 Copyright (C) 2005, 2006, 2007 Sergey Poznyakoff 2 Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -33,6 +33,9 @@
33#include <netinet/in.h> 33#include <netinet/in.h>
34#include <arpa/inet.h> 34#include <arpa/inet.h>
35#include <netdb.h> 35#include <netdb.h>
36#ifdef HAVE_LOCALE_H
37# include <locale.h>
38#endif
36 39
37#include <mailutils/mailutils.h> 40#include <mailutils/mailutils.h>
38#if MAILUTILS_VERSION_NUMBER < 1290 41#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 @@
1/* 1/*
2 This file is part of Mailfromd. 2 This file is part of Mailfromd.
3 Copyright (C) 2003, 2004, 2007 The Anubis Team. 3 Copyright (C) 2003, 2004, 2007, 2008 The Anubis Team.
4 4
5 Mailfromd is free software; you can redistribute it and/or modify 5 Mailfromd is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -36,6 +36,9 @@
36# include <readline/readline.h> 36# include <readline/readline.h>
37# include <readline/history.h> 37# include <readline/history.h>
38#endif 38#endif
39#ifdef HAVE_LOCALE_H
40# include <locale.h>
41#endif
39 42
40#include <pwd.h> 43#include <pwd.h>
41#include <sys/stat.h> 44#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 @@
1/* This file is part of mailfromd. 1/* This file is part of mailfromd.
2 Copyright (C) 2006, 2007 Sergey Poznyakoff 2 Copyright (C) 2006, 2007, 2008 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -410,12 +410,12 @@ runtime_stack_trace(eval_environ_t env)
410 } 410 }
411 411
412 if (ploc) 412 if (ploc)
413 mu_error("%04d: %s:%lu: %s", 413 mu_error("%04lu: %s:%lu: %s",
414 (unsigned long) pc, 414 (unsigned long) pc,
415 ploc->file, (unsigned long) ploc->line, 415 ploc->file, (unsigned long) ploc->line,
416 name); 416 name);
417 else 417 else
418 mu_error("%04d: %s", 418 mu_error("%04lu: %s",
419 (unsigned long) pc, 419 (unsigned long) pc,
420 name); 420 name);
421 } 421 }
@@ -1087,7 +1087,7 @@ instr_div(eval_environ_t env)
1087 prog_trace(env, "DIV %ld %ld", a, b); 1087 prog_trace(env, "DIV %ld %ld", a, b);
1088 if (b == 0) 1088 if (b == 0)
1089 env_throw(env, mf_divzero, 1089 env_throw(env, mf_divzero,
1090 "Division by zero at %08x", env->pc); 1090 "Division by zero at %08lx", (unsigned long)env->pc);
1091 push(env, (STKVAL) (a / b)); 1091 push(env, (STKVAL) (a / b));
1092} 1092}
1093 1093

Return to:

Send suggestions and report system problems to the System administrator.