~ubuntu-branches/ubuntu/trusty/lifelines/trusty

« back to all changes in this revision

Viewing changes to src/liflines/error.c

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Augusto van de Wiel (faw)
  • Date: 2007-08-14 00:02:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.4 gutsy)
  • Revision ID: james.westby@ubuntu.com-20070814000204-mpv5faygl0dgq3qi
Tags: 3.0.61-1
* New upstream release. (Closes: #387856).
* Fixing documentation build problems also fixes FTBFS if built twice in a
  row. (Closes: #424543).
* Adding lynx as a build dependency. This is necessary to generate txt files
  from html, discovered while fixing #424543.
* Upstream fix: charset for gedcom file in unicode. (Closes: #396206).
* Upstream fim: updating documentation about desc-tex2. (Closes: #405501).
* Bumping Standards-Version to 3.7.2 without package changes.
* Dropping local debian patches added upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#define INCLUDED_STDARG_H
39
39
#endif
40
40
 
 
41
static void vcrashlog(int newline, const char * fmt, va_list args);
 
42
 
41
43
 
42
44
/*
43
45
 2002/10/05
74
76
        exit(1);
75
77
}
76
78
/*===============================
77
 
 * __crashlog -- Details preceding a fatal error
 
79
 * vcrashlog -- Send crash info to crash log and screen
 
80
 *  internal implementation
78
81
 *=============================*/
79
 
void
80
 
crashlog (STRING fmt, ...)
 
82
static void
 
83
vcrashlog (int newline, const char * fmt, va_list args)
81
84
{
82
85
        char buffer[2048];
83
 
        va_list args;
84
 
        va_start(args, fmt);
85
86
        vsnprintf(buffer, sizeof(buffer), fmt, args);
86
 
        va_end(args);
 
87
        buffer[sizeof(buffer)-1] = 0;
 
88
        if (newline) {
 
89
                /* ensure room at end to append \n */
 
90
                buffer[sizeof(buffer)-2] = 0;
 
91
                strcat(buffer, "\n");
 
92
        }
87
93
 
88
94
        /* send to error log if one is specified */
89
95
        errlog_out(NULL, buffer, NULL, -1);
91
97
        /* send to screen */
92
98
        llwprintf(buffer);
93
99
}
 
100
/*===============================
 
101
 * vcrashlog -- Send crash info to crash log and screen
 
102
 *=============================*/
 
103
void
 
104
crashlog (STRING fmt, ...)
 
105
{
 
106
        va_list args;
 
107
        va_start(args, fmt);
 
108
        vcrashlog(0, fmt, args);
 
109
        va_end(args);
 
110
}
 
111
/*===============================
 
112
 * vcrashlog -- Send crash info to crash log and screen
 
113
 *  add carriage return to end line
 
114
 *=============================*/
 
115
void
 
116
crashlogn (STRING fmt, ...)
 
117
{
 
118
        va_list args;
 
119
        va_start(args, fmt);
 
120
        vcrashlog(1, fmt, args);
 
121
        va_end(args);
 
122
}