added more 'const'
authoraland <aland>
Wed, 3 Nov 1999 19:57:22 +0000 (19:57 +0000)
committeraland <aland>
Wed, 3 Nov 1999 19:57:22 +0000 (19:57 +0000)
src/include/libradius.h
src/lib/dict.c
src/main/radiusd.c
src/main/radzap.c
src/main/timestr.c

index 05a7525..1d3cb0f 100644 (file)
@@ -118,7 +118,7 @@ void                vp_printlist(FILE *, VALUE_PAIR *);
 int            dict_addvendor(const char *name, int value);
 int            dict_addattr(const char *name, int vendor, int type, int value);
 int            dict_addvalue(const char *namestr, char *attrstr, int value);
-int            dict_init(char *dir, char *fn);
+int            dict_init(const char *dir, const char *fn);
 DICT_ATTR      *dict_attrbyvalue(int attr);
 DICT_ATTR      *dict_attrbyname(const char *attr);
 DICT_VALUE     *dict_valbyattr(int attr, int val);
index 9691f64..afd582e 100644 (file)
@@ -166,7 +166,7 @@ int dict_addvalue(const char *namestr, char *attrstr, int value)
 /*
  *     Initialize the dictionary.
  */
-static int my_dict_init(char *dir, char *fn, char *src_file, int src_line)
+static int my_dict_init(const char *dir, const char *fn, const char *src_file, int src_line)
 {
        FILE    *fp;
        char    dirtmp[256];
@@ -466,7 +466,7 @@ static int my_dict_init(char *dir, char *fn, char *src_file, int src_line)
  *     Initialize the directory, then fix the attr member of
  *     all attributes.
  */
-int dict_init(char *dir, char *fn)
+int dict_init(const char *dir, const char *fn)
 {
        DICT_ATTR       *attr;
        DICT_VALUE      *dval;
index 42c7b6e..8f98d94 100644 (file)
@@ -41,10 +41,10 @@ static const char rcsid[] =
 /*
  *     Global variables.
  */
-char                   *progname;
-char                   *radius_dir;
-char                   *radacct_dir;
-char                   *radlog_dir;
+const char             *progname;
+const char             *radius_dir;
+const char             *radacct_dir;
+const char             *radlog_dir;
 int                    log_stripped_names;
 int                    cache_passwd = 0;
 int                    debug_flag;
@@ -861,7 +861,7 @@ static void usage(void)
  */
 static void sig_fatal(int sig)
 {
-       char *me = "MASTER: ";
+       const char *me = "MASTER: ";
 
        if (radius_pid == getpid()) {
                /*
index b5420c9..d50b3ae 100644 (file)
@@ -27,8 +27,8 @@
 #include       "radiusd.h"
 
 int debug_flag = 0;
-char *progname = "radzap";
-char *radlog_dir = NULL;
+const char *progname = "radzap";
+const char *radlog_dir = NULL;
 
 /*
  *     Zap a user from the radutmp and radwtmp file.
index 18f8315..7003226 100644 (file)
@@ -13,7 +13,7 @@
 #include <time.h>
 #include <ctype.h>
 
-static char *days[] =
+static const char *days[] =
        { "su", "mo", "tu", "we", "th", "fr", "sa", "wk", "any", "al" };
 
 #define DAYMIN         (24*60)