"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dummies.c" between
exim-4.91.tar.xz and exim-4.92.tar.xz

About: Exim is a message transfer agent (MTA).

dummies.c  (exim-4.91.tar.xz):dummies.c  (exim-4.92.tar.xz)
skipping to change at line 23 skipping to change at line 23
alternates. */ alternates. */
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
/* We don't have the full Exim headers dragged in, but this function /* We don't have the full Exim headers dragged in, but this function
is used for debugging output. */ is used for debugging output. */
extern int string_vformat(char *, int, char *, va_list); extern gstring * string_vformat(gstring *, BOOL, const char *, va_list);
/************************************************* /*************************************************
* Handle calls to write the log * * Handle calls to write the log *
*************************************************/ *************************************************/
/* The message gets written to stderr when log_write() is called from a /* The message gets written to stderr when log_write() is called from a
utility. The message always gets '\n' added on the end of it. utility. The message always gets '\n' added on the end of it.
Arguments: Arguments:
selector not relevant when running a utility selector not relevant when running a utility
skipping to change at line 70 skipping to change at line 70
format a printf() format format a printf() format
... arguments for format ... arguments for format
Returns: nothing Returns: nothing
*/ */
void void
debug_printf(char *format, ...) debug_printf(char *format, ...)
{ {
va_list ap; va_list ap;
char buffer[1024]; gstring * g = string_get(1024);
void * reset_point = g;
va_start(ap, format); va_start(ap, format);
if (!string_vformat(buffer, sizeof(buffer), format, ap)) if (!string_vformat(g, FALSE, format, ap))
{ {
char *s = "**** debug string overflowed buffer ****\n"; char * s = "**** debug string overflowed buffer ****\n";
char *p = buffer + (int)strlen(buffer); char * p = CS g->s + g->ptr;
int maxlen = sizeof(buffer) - (int)strlen(s) - 3; int maxlen = g->size - (int)strlen(s) - 3;
if (p > buffer + maxlen) p = buffer + maxlen; if (p > g->s + maxlen) p = g->s + maxlen;
if (p > buffer && p[-1] != '\n') *p++ = '\n'; if (p > g->s && p[-1] != '\n') *p++ = '\n';
strcpy(p, s); strcpy(p, s);
} }
fprintf(stderr, "%s", buffer); fprintf(stderr, "%s", string_from_gstring(g));
fflush(stderr); fflush(stderr);
store_reset(reset_point);
va_end(ap); va_end(ap);
} }
/************************************************* /*************************************************
* SIGALRM handler * * SIGALRM handler *
*************************************************/ *************************************************/
extern int sigalrm_seen; extern int sigalrm_seen;
void void
sigalrm_handler(int sig) sigalrm_handler(int sig)
{ {
sig = sig; /* Keep picky compilers happy */ sig = sig; /* Keep picky compilers happy */
sigalrm_seen = 1; sigalrm_seen = TRUE;
} }
/************************************************* /*************************************************
* Complete Dummies * * Complete Dummies *
*************************************************/ *************************************************/
int int
header_checkname(void *h, char *name, int len) header_checkname(void *h, char *name, int len)
{ {
h = h; /* Keep picky compilers happy */ h = h; /* Keep picky compilers happy */
 End of changes. 7 change blocks. 
10 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)