From: Simon Matter Date: Tue, 8 Mar 2011 07:27:00 +0000 (+0000) Subject: Fix issues with some older GCC compilers X-Git-Tag: v2.3-alpha1~235 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa52ca828fc075e010c326e91d2171484a514fde;p=thirdparty%2Fopenvpn.git Fix issues with some older GCC compilers Some older GCC compilers don't like that variables are declared in the middle of the code, and expect them on the top in the block/scope. Trac-ticket: 99 Signed-off-by: Simon Matter Acked-by: David Sommerseth Signed-off-by: David Sommerseth --- diff --git a/plugin/auth-pam/auth-pam.c b/plugin/auth-pam/auth-pam.c index a06a48e25..e52f6322a 100644 --- a/plugin/auth-pam/auth-pam.c +++ b/plugin/auth-pam/auth-pam.c @@ -121,14 +121,14 @@ static void pam_server (int fd, const char *service, int verb, const struct name static char * searchandreplace(const char *tosearch, const char *searchfor, const char *replacewith) { - if (!tosearch || !searchfor || !replacewith) return 0; - if (!strlen(tosearch) || !strlen(searchfor) || !strlen(replacewith)) return 0; - const char *searching=tosearch; char *scratch; char temp[strlen(tosearch)*10]; temp[0]=0; + if (!tosearch || !searchfor || !replacewith) return 0; + if (!strlen(tosearch) || !strlen(searchfor) || !strlen(replacewith)) return 0; + scratch = strstr(searching,searchfor); if (!scratch) return strdup(tosearch);