Changeset 20 for trunk/src/sh_utils.c


Ignore:
Timestamp:
Feb 13, 2006, 11:54:42 PM (19 years ago)
Author:
rainer
Message:

Enable command-line parsing for prelude, and make prelude regression test safer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_utils.c

    r13 r20  
    5151UINT32 ErrFlag[2];
    5252
    53 int sh_util_flagval(char * c, int * fval)
     53int sh_util_flagval(const char * c, int * fval)
    5454{
    5555  SL_ENTER(_("sh_util_flagval"));
     
    101101static int sh_ask_update = S_FALSE;
    102102
    103 int sh_util_set_interactive(char * str)
    104 {
    105   if (str == NULL)
    106     sh_ask_update = S_TRUE;
    107   else
    108     sh_ask_update = S_TRUE;
     103int sh_util_set_interactive(const char * str)
     104{
     105  (void) str;
     106
     107  sh_ask_update = S_TRUE;
    109108
    110109  sh_unix_setnodeamon(NULL);
     
    950949static void copy_four (unsigned char * dest, UINT32 in);
    951950
    952 int sh_util_set_newkey (char * new)
     951int sh_util_set_newkey (const char * new_in)
    953952{
    954953  size_t i, j = 0;
     
    964963  long ii, k = 0;
    965964  UINT32    * h1;
     965  char * new;
    966966
    967967  if (0 != sl_is_suid())
     
    973973    }
    974974       
    975   if (new == NULL || new[0] == '\0')
     975  if (new_in == NULL || new_in[0] == '\0')
    976976    {
    977977      fprintf(stderr,
     
    981981      return -1;
    982982    }
     983
     984  if (NULL == (new = malloc(strlen(new_in) + 1)))
     985    goto bail_mem;
     986  sl_strncpy(new, new_in, strlen(new_in) + 1);
     987
    983988  key = new;
    984989  len = strlen(new);
     
    11581163/* server mode
    11591164 */
    1160 int sh_util_setserver (char * dummy)
     1165int sh_util_setserver (const char * dummy)
    11611166{
    11621167  SL_ENTER(_("sh_util_setserver"));
    11631168
    1164   if (dummy)
    1165     sh.flag.isserver = GOOD;
    1166   else
    1167     sh.flag.isserver = GOOD;
     1169  (void) dummy;
     1170  sh.flag.isserver = GOOD;
    11681171  SL_RETURN((0),_("sh_util_setserver"));
    11691172}
    11701173
    11711174
    1172 int sh_util_setlooptime (char * str)
     1175int sh_util_setlooptime (const char * str)
    11731176{
    11741177  int i = atoi (str);
     
    11871190
    11881191#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
    1189 int  sh_util_setchecksum (char * str)
     1192int  sh_util_setchecksum (const char * str)
    11901193{
    11911194  static int reject = 0;
Note: See TracChangeset for help on using the changeset viewer.