From dd7d84ccf6c8df0f106025d075987a180e653a49 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 1 Dec 2010 13:46:00 -0500 Subject: don't hardcode defaults --- expac.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'expac.c') diff --git a/expac.c b/expac.c index 6e4ddba..96598fe 100644 --- a/expac.c +++ b/expac.c @@ -34,6 +34,9 @@ #include #include +#define DEFAULT_DELIM "\n" +#define DEFAULT_LISTDELIM " " +#define DEFAULT_TIMEFMT "%c" #define FORMAT_TOKENS "BCDEGLNOPRSabdkmnprsuvw%" #define FORMAT_TOKENS_LOCAL "ilFw" #define FORMAT_TOKENS_SYNC "f" @@ -535,7 +538,7 @@ alpm_list_t *resolve_pkg(alpm_list_t *targets) { } int main(int argc, char *argv[]) { - int ret = 0; + int ret; alpm_list_t *results, *i; ret = alpm_init(); @@ -553,9 +556,9 @@ int main(int argc, char *argv[]) { local = true; dblist = alpm_list_add(dblist, db_local); } - delim = delim ? delim : "\n"; - listdelim = listdelim ? listdelim : " "; - timefmt = timefmt ? timefmt : "%c"; + delim = delim ? delim : DEFAULT_DELIM; + listdelim = listdelim ? listdelim : DEFAULT_LISTDELIM; + timefmt = timefmt ? timefmt : DEFAULT_TIMEFMT; if (verify_format_string(format) != 0) { return(1); -- cgit v1.2.3-70-g09d2