From 79d40a536ad23e514a45746e611429a3bd5f6df3 Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Tue, 24 Aug 2004 16:34:22 +0000 Subject: (get_bool_arg): Moved the initialization of "p" _before_ the assert() calls. The code doesn't compile under gcc 2.95 otherwise. (I'm surprised it compiles under gcc 3.3 without a problem.) --- src/conffile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/conffile.c b/src/conffile.c index 7b1430f..54c5c50 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -1,4 +1,4 @@ -/* $Id: conffile.c,v 1.3 2004-08-14 03:18:41 rjkaes Exp $ +/* $Id: conffile.c,v 1.4 2004-08-24 16:34:22 rjkaes Exp $ * * Parses the configuration file and sets up the config_s structure for * use by the application. This file replaces the old grammar.y and @@ -323,11 +323,11 @@ set_string_arg(char** var, const char* line, regmatch_t* match) static int get_bool_arg(const char* line, regmatch_t* match) { + const char* p = line + match->rm_so; + assert(line); assert(match && match->rm_so != -1); - const char* p = line + match->rm_so; - /* "y"es or o"n" map as true, otherwise it's false. */ if (tolower(p[0]) == 'y' || tolower(p[1]) == 'n') return 1; -- cgit v1.2.3