1 diff -burNp conky-1.8.0/configure.ac.in conky-1.8.0-dud/configure.ac.in
2 --- conky-1.8.0/configure.ac.in 2010-03-30 19:47:30.000000000 +0200
3 +++ conky-1.8.0-dud/configure.ac.in 2010-04-08 22:13:46.056130555 +0200
4 @@ -1011,6 +1011,7 @@ dnl OpenMP: $want_openmp
7 I/O stats: $want_iostats
8 + ncurses: $want_ncurses
10 * Lua ($want_lua) bindings:
11 Cairo: $want_lua_cairo
12 diff -burNp conky-1.8.0/src/conky.c conky-1.8.0-dud/src/conky.c
13 --- conky-1.8.0/src/conky.c 2010-03-25 21:27:32.000000000 +0100
14 +++ conky-1.8.0-dud/src/conky.c 2010-04-08 22:25:15.789443783 +0200
15 @@ -3119,36 +3119,48 @@ int draw_each_line_inner(char *s, int sp
17 timeunits = seconds / 86400; seconds %= 86400;
19 - asprintf(&tmp_day_str, "%dd", timeunits);
20 + if (asprintf(&tmp_day_str, "%dd", timeunits) < 0) {
24 tmp_day_str = strdup("");
26 timeunits = seconds / 3600; seconds %= 3600;
28 - asprintf(&tmp_hour_str, "%dh", timeunits);
29 + if (asprintf(&tmp_hour_str, "%dh", timeunits) < 0) {
33 tmp_hour_str = strdup("");
35 timeunits = seconds / 60; seconds %= 60;
37 - asprintf(&tmp_min_str, "%dm", timeunits);
38 + if (asprintf(&tmp_min_str, "%dm", timeunits) < 0) {
42 tmp_min_str = strdup("");
45 - asprintf(&tmp_sec_str, "%ds", seconds);
46 + if (asprintf(&tmp_sec_str, "%ds", seconds) < 0) {
50 tmp_sec_str = strdup("");
52 - asprintf(&tmp_str, "%s%s%s%s", tmp_day_str, tmp_hour_str, tmp_min_str, tmp_sec_str);
53 - free(tmp_day_str); free(tmp_hour_str); free(tmp_min_str); free(tmp_sec_str);
54 + if (asprintf(&tmp_str, "%s%s%s%s", tmp_day_str, tmp_hour_str, tmp_min_str, tmp_sec_str) < 0) {
57 +#define FREE(a) if ((a)) free((a));
58 + FREE(tmp_day_str); FREE(tmp_hour_str); FREE(tmp_min_str); FREE(tmp_sec_str);
60 - asprintf(&tmp_str, "Range not possible"); // should never happen, but better safe then sorry
61 + tmp_str = strdup("Range not possible"); /* should never happen, but better safe then sorry */
63 cur_x += (w / 2) - (font_ascent() * (strlen(tmp_str) / 2));
72 @@ -4518,13 +4530,13 @@ void setalignment(int* ltext_alignment,
73 int a = string_to_alignment(value);
76 - if(setbyconffile == true) {
77 + if (setbyconffile) {
79 } else NORM_ERR("'%s' is not a alignment setting", value);
83 - } else if(setbyconffile == true) {
84 + } else if (setbyconffile) {
88 @@ -4573,7 +4585,7 @@ char load_config_file(const char *f)
92 - setalignment(&text_alignment, window.type, value, f, line, true);
93 + setalignment(&text_alignment, window.type, value, f, line, 1);
96 fork_to_background = string_to_bool(value);
97 @@ -5696,7 +5708,7 @@ void initialisation(int argc, char **arg
98 set_first_font(optarg);
101 - setalignment(&text_alignment, window.type, optarg, NULL, 0, false);
102 + setalignment(&text_alignment, window.type, optarg, NULL, 0, 0);
106 @@ -5895,7 +5907,9 @@ int main(int argc, char **argv)
107 current_config = strndup(optarg, max_user_text);
110 - freopen("/dev/null", "w", stderr);
111 + if (!freopen("/dev/null", "w", stderr)) {
112 + NORM_ERR("unable to redirect stderr to /dev/null");
117 diff -burNp conky-1.8.0/src/conky.c conky-1.8.0-dud/src/conky.c
118 --- conky-1.8.0/src/conky.c 2010-03-25 21:27:32.000000000 +0100
119 +++ conky-1.8.0-dud/src/conky.c 2010-04-08 22:30:40.745051008 +0200
124 -#include <ncurses.h>
125 +#include <ncurses/ncurses.h>
128 #include <libxml/parser.h>
129 diff -burNp conky-1.8.0/src/core.c conky-1.8.0-dud/src/core.c
130 --- conky-1.8.0/src/core.c 2010-03-25 21:27:32.000000000 +0100
131 +++ conky-1.8.0-dud/src/core.c 2010-04-09 10:24:30.287419400 +0200
136 -#include <ncurses.h>
137 +#include <ncurses/ncurses.h>
140 /* check for OS and include appropriate headers */