]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - win/configure.cpp
Move STATS handler back to cmd_stats so it's hotpatchable again
[user/henk/code/inspircd.git] / win / configure.cpp
index 4acd7131b411a69194a9b965aa4111039e82f454..ee03b3659e95a5f158217eedcef56a1d7d5085b0 100644 (file)
@@ -1,16 +1,27 @@
-/*        +------------------------------------+
- *        | Inspire Internet Relay Chat Daemon |
- *        +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2011 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2011 Adam <Adam@anope.org>
+ *   Copyright (C) 2007, 2009 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2007-2008 Craig Edwards <craigedwards@brainbox.cc>
+ *   Copyright (C) 2008 Eric Dietz <root@wrongway.org>
+ *   Copyright (C) 2007 Burlex <???@???>
+ *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
  *
- * This program is free but copyrighted software; see
- *                     the file COPYING for details.
+ * This file is part of InspIRCd.  InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
  *
- * ---------------------------------------------------
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #define _CRT_SECURE_NO_DEPRECATE
 
 #define CONFIGURE_BUILD
@@ -50,7 +61,7 @@ int get_int_option(const char * text, int def)
        static char buffer[500];
        int ret;
        printf_c("%s\n[\033[1;32m%u\033[0m] -> ", text, def);
-       fgets(buffer, 500, stdin);
+       fgets(buffer, sizeof(buffer), stdin);
        if(sscanf(buffer, "%u", &ret) != 1)
                ret = def;
 
@@ -63,7 +74,7 @@ bool get_bool_option(const char * text, bool def)
        static char buffer[500];
        char ret[100];
        printf_c("%s [\033[1;32m%c\033[0m] -> ", text, def ? 'y' : 'n');
-       fgets(buffer, 500, stdin);
+       fgets(buffer, sizeof(buffer), stdin);
        if(sscanf(buffer, "%s", ret) != 1)
                strcpy(ret, def ? "y" : "n");
 
@@ -148,7 +159,7 @@ void get_machine_info(char * buffer, size_t len)
        FILE * f = fopen("ver.txt.tmp", "r");
        if (f)
        {
-               while (fgets(buf2, 500, f)) { }
+               while (fgets(buf2, sizeof(buf2), f)) { }
                fclose(f);
                unlink("ver.txt.tmp");
        }
@@ -250,8 +261,8 @@ void Run()
        FILE * fI = fopen("..\\src\\version.sh", "r");
        if(fI)
        {
-               fgets(version, 514, fI);
-               fgets(version, 514, fI);
+               fgets(version, sizeof(version), fI);
+               fgets(version, sizeof(version), fI);
                char * p2 = version;
                while(*p2 != '\"')
                        ++p2;
@@ -330,7 +341,7 @@ void Run()
        printf("Writing inspircd_se_config.h...");
 
        f = fopen("inspircd_se_config.h", "w");
-       fprintf(f, "/* Auto generated by configure, do not modify or commit to svn! */\n");
+       fprintf(f, "/* Auto generated by configure, do not modify or commit to Git! */\n");
        fprintf(f, "#ifndef __CONFIGURATION_SOCKETENGINE__\n");
        fprintf(f, "#define __CONFIGURATION_SOCKETENGINE__\n\n");
        fprintf(f, "#include \"socketengines/socketengine_%s.h\"\n\n", "select");