]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix issues with some older GCC compilers
authorSimon Matter <simon.matter@invoca.ch>
Tue, 8 Mar 2011 07:27:00 +0000 (07:27 +0000)
committerDavid Sommerseth <davids@redhat.com>
Tue, 10 May 2011 08:51:18 +0000 (10:51 +0200)
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 <simon.matter@invoca.ch>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
plugin/auth-pam/auth-pam.c

index a06a48e2555d40a03d1f762f45512a28610a31dc..e52f6322a0a13f5758b19f6e159fb8384c8eb800 100644 (file)
@@ -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);