From a8d12cceb5beafde5bce04931175d4d931798773 Mon Sep 17 00:00:00 2001 From: James Morris Date: Sat, 12 Jan 2013 13:32:57 +0000 Subject: [PATCH 1/4] minor modernization of autotools files --- configure.ac.in | 4 ++-- src/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index 23b59b3c..bea300ba 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -13,9 +13,9 @@ m4_define([conky_version], [ifelse(conky_version_tag(), [], [], [conky_version_tag()])])]) AC_INIT([Conky], [conky_version()], [brenden1@users.sourceforge.net]) +AM_INIT_AUTOMAKE -AM_INIT_AUTOMAKE(conky, conky_version()) -AM_CONFIG_HEADER(src/config.h) +AC_CONFIG_HEADERS(src/config.h) AC_CONFIG_MACRO_DIR([m4]) dnl prevent libtool setting LTCFLAGS to default of -g -O2 when CFLAGS unset. diff --git a/src/Makefile.am b/src/Makefile.am index 03ba9cd0..cc52a6a2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,7 @@ # along with this program. If not, see . # -INCLUDES = -DSYSTEM_CONFIG_FILE=\"$(sysconfdir)/conky/conky.conf\" -DPACKAGE_LIBDIR=\"$(pkglibdir)\" +AM_CFLAGS = -DSYSTEM_CONFIG_FILE=\"$(sysconfdir)/conky/conky.conf\" -DPACKAGE_LIBDIR=\"$(pkglibdir)\" bin_PROGRAMS = conky From 588c2967841d4fb566c2e7abed4b80a0a75c00b8 Mon Sep 17 00:00:00 2001 From: James Morris Date: Sat, 12 Jan 2013 15:24:06 +0000 Subject: [PATCH 2/4] minor autotools modernization take 2 --- configure.ac.in | 2 +- src/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index bea300ba..b8dcec0f 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -488,7 +488,7 @@ fi AM_CONDITIONAL(BUILD_LUA, test x$want_lua = xyes) if test x$want_lua = xyes; then - PKG_CHECK_MODULES(LUA, lua >= 5.1, [ ],[ + PKG_CHECK_MODULES(LUA, lua == 5.1, [ ],[ PKG_CHECK_MODULES(LUA51, lua-5.1 >= 5.1, [ ],[ PKG_CHECK_MODULES(LUA51, lua5.1 >= 5.1) ]) diff --git a/src/Makefile.am b/src/Makefile.am index cc52a6a2..19a7f9e8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,7 @@ # along with this program. If not, see . # -AM_CFLAGS = -DSYSTEM_CONFIG_FILE=\"$(sysconfdir)/conky/conky.conf\" -DPACKAGE_LIBDIR=\"$(pkglibdir)\" +AM_CPPFLAGS = -DSYSTEM_CONFIG_FILE=\"$(sysconfdir)/conky/conky.conf\" -DPACKAGE_LIBDIR=\"$(pkglibdir)\" bin_PROGRAMS = conky From a1d1a4f076a729c85eb94167acb9776d99dc0072 Mon Sep 17 00:00:00 2001 From: James Morris Date: Sat, 12 Jan 2013 17:05:52 +0000 Subject: [PATCH 3/4] fix mem corruption originating in load_xoap_keys --- src/weather.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/weather.c b/src/weather.c index b676d017..3c618387 100644 --- a/src/weather.c +++ b/src/weather.c @@ -879,7 +879,7 @@ void load_xoap_keys(void) FILE *fp; char *par = (char *) malloc(11 * sizeof(char)); char *key = (char *) malloc(17 * sizeof(char)); - char *xoap = (char *) malloc(64 * sizeof(char)); + char *xoap = (char *) malloc(DEFAULT_TEXT_BUFFER_SIZE * sizeof(char)); to_real_path(xoap, XOAP_FILE); fp = fopen(xoap, "r"); From b0a22d534d321f21ce7e6fe1d099271da28010eb Mon Sep 17 00:00:00 2001 From: James Morris Date: Sat, 12 Jan 2013 17:07:23 +0000 Subject: [PATCH 4/4] cut $HOME when $HOME not found --- src/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 380596cb..d56eae05 100644 --- a/src/common.c +++ b/src/common.c @@ -110,7 +110,8 @@ void to_real_path(char *dest, const char *source) snprintf(dest, DEFAULT_TEXT_BUFFER_SIZE, "%s/%s", homedir, tmp); } else { NORM_ERR("$HOME environment variable doesn't exist"); - strncpy(dest, source, DEFAULT_TEXT_BUFFER_SIZE); + /*strncpy(dest, source, DEFAULT_TEXT_BUFFER_SIZE);*/ + strncpy(dest, tmp, DEFAULT_TEXT_BUFFER_SIZE); } } else if (dest != source) { //see changelog 2009-06-29 if you doubt that this check is necessary strncpy(dest, source, DEFAULT_TEXT_BUFFER_SIZE);