Index: ChangeLog
===================================================================
--- ChangeLog	(revision 5533)
+++ ChangeLog	(revision 5534)
@@ -4,4 +4,5 @@
 	* Fixed usage of -R/-B/-C/-E as well as --aiprofile in roarclients
 	  (Closes: #176)
+	* Done more hardending work.
 
 v. 1.0beta2 - Wed Jun 06 2012 19:56 CEST
Index: roarclients/roarbidir.c
===================================================================
--- roarclients/roarbidir.c	(revision 5533)
+++ roarclients/roarbidir.c	(revision 5534)
@@ -46,6 +46,6 @@
 int main (int argc, char * argv[]) {
  struct roar_audio_info info;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
  struct roar_vio_defaults  def;
Index: roarclients/roarcat.c
===================================================================
--- roarclients/roarcat.c	(revision 5533)
+++ roarclients/roarcat.c	(revision 5534)
@@ -61,8 +61,8 @@
  int    rel_id   = -1;
  int    role     = ROAR_ROLE_UNKNOWN;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
- char * name = "roarcat";
+ const char * name = "roarcat";
  struct roar_connection    con;
  struct roar_stream        s;
Index: roarclients/roarcat2sock.c
===================================================================
--- roarclients/roarcat2sock.c	(revision 5381)
+++ roarclients/roarcat2sock.c	(revision 5534)
@@ -47,6 +47,6 @@
  int    channels = 2;
  int    codec    = ROAR_CODEC_DEFAULT;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
  int    fh;
Index: roarclients/roarcatad.c
===================================================================
--- roarclients/roarcatad.c	(revision 5381)
+++ roarclients/roarcatad.c	(revision 5534)
@@ -47,6 +47,6 @@
  int    channels = 2;
  int    codec    = ROAR_CODEC_DEFAULT;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
  char buf[BUFSIZE];
Index: roarclients/roarcatplay.c
===================================================================
--- roarclients/roarcatplay.c	(revision 5381)
+++ roarclients/roarcatplay.c	(revision 5534)
@@ -42,8 +42,8 @@
 
 int main (int argc, char * argv[]) {
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
- char * file    = NULL;
+ const char * file    = NULL;
  int    verbose = 0;
  roar_vs_t * vss;
Index: roarclients/roarcatsendfile.c
===================================================================
--- roarclients/roarcatsendfile.c	(revision 5381)
+++ roarclients/roarcatsendfile.c	(revision 5534)
@@ -48,6 +48,6 @@
  int    channels = 2;
  int    codec    = ROAR_CODEC_DEFAULT;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    fh;
  int    i;
Index: roarclients/roarcatvio.c
===================================================================
--- roarclients/roarcatvio.c	(revision 5533)
+++ roarclients/roarcatvio.c	(revision 5534)
@@ -50,10 +50,10 @@
                                 .codec = ROAR_AUDIO_INFO_INVALID};
  int    auinfo_changed = 0;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
- char * name = "roarcatvio";
+ const char * name = "roarcatvio";
  roar_vs_t * vss;
- char * filename = NULL;
+ const char * filename = NULL;
  int err;
 
Index: roarclients/roarclientpass.c
===================================================================
--- roarclients/roarclientpass.c	(revision 5381)
+++ roarclients/roarclientpass.c	(revision 5534)
@@ -115,6 +115,6 @@
  struct roar_connection    con;
  struct roar_client        client;
- char * server    = NULL;
- char * k;
+ const char * server    = NULL;
+ const char * k;
  int    i;
  int    clientfh  = -1;
@@ -125,5 +125,5 @@
  int    mode      = ROAR_SOCKET_MODE_NONE;
  int    type      = ROAR_SOCKET_TYPE_UNKNOWN;
- char * host      = NULL;
+ const char * host      = NULL;
  int    port      = -1;
  enum {PASSFH, EXEC} command = PASSFH;
Index: roarclients/roarctl.c
===================================================================
--- roarclients/roarctl.c	(revision 5387)
+++ roarclients/roarctl.c	(revision 5534)
@@ -1195,6 +1195,6 @@
 int main (int argc, char * argv[]) {
  struct roar_connection con;
- char * server   = NULL;
- char * k = NULL;
+ const char * server   = NULL;
+ const char * k = NULL;
  int    i;
  int    t = 0;
Index: roarclients/roardtmf.c
===================================================================
--- roarclients/roardtmf.c	(revision 5533)
+++ roarclients/roardtmf.c	(revision 5534)
@@ -122,10 +122,10 @@
 int main (int argc, char * argv[]) {
  int    rate     = ROAR_RATE_DEFAULT;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
- char * name = "roardtmf";
+ const char * name = "roardtmf";
  roar_vs_t * vss = NULL;
- char * tones = NULL;
+ const char * tones = NULL;
  void * buf;
  size_t samples;
Index: roarclients/roarfilt.c
===================================================================
--- roarclients/roarfilt.c	(revision 5533)
+++ roarclients/roarfilt.c	(revision 5534)
@@ -138,6 +138,6 @@
 int main (int argc, char * argv[]) {
  struct roar_audio_info info;
- char  * server   = NULL;
- char  * k;
+ const char  * server   = NULL;
+ const char  * k;
  int     i;
  int32_t mul = 1, div = 1;
Index: roarclients/roarinterconnect.c
===================================================================
--- roarclients/roarinterconnect.c	(revision 5533)
+++ roarclients/roarinterconnect.c	(revision 5534)
@@ -265,5 +265,5 @@
  int    type     = parse_type(NULL);
  int    tmp;
- char * server   = NULL;
+ const char * server   = NULL;
  char * remote   = "+slp"; // we hope SLP located server is not local one
  char * k;
Index: roarclients/roarlight.c
===================================================================
--- roarclients/roarlight.c	(revision 5381)
+++ roarclients/roarlight.c	(revision 5534)
@@ -97,6 +97,6 @@
  struct roar_connection con;
  int    mixer = -1; // -1 = Default
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
 
Index: roarclients/roarmon.c
===================================================================
--- roarclients/roarmon.c	(revision 5533)
+++ roarclients/roarmon.c	(revision 5534)
@@ -62,6 +62,6 @@
  int    dir      = ROAR_DIR_MONITOR;
  int    rel_id   = -1;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
  int    prethru  = 0;
Index: roarclients/roarmonhttp.c
===================================================================
--- roarclients/roarmonhttp.c	(revision 5533)
+++ roarclients/roarmonhttp.c	(revision 5534)
@@ -236,7 +236,8 @@
  int    sflags   = ROAR_FLAG_NONE;
 // int    codec    = ROAR_CODEC_DEFAULT;
- char * server   = NULL;
+ const char * server   = NULL;
  int    i;
- char * c, * k, * v;
+ const char * k, * v;
+ char * c;
  char * sp0 = NULL, * sp1 = NULL;
  int dir = ROAR_DIR_MONITOR;
Index: roarclients/roarphone.c
===================================================================
--- roarclients/roarphone.c	(revision 5533)
+++ roarclients/roarphone.c	(revision 5534)
@@ -156,5 +156,5 @@
 }
 
-int open_stream (struct roar_vio_calls * vio, char * server, struct roar_audio_info * info) {
+int open_stream (struct roar_vio_calls * vio, const char * server, struct roar_audio_info * info) {
  int fh;
 
@@ -404,8 +404,8 @@
  struct roar_vio_calls * svio_p;
  struct roardsp_filter * filter;
- char * driver   = DRIVER;
- char * device   = NULL;
- char * server   = NULL;
- char * k;
+ const char * driver   = DRIVER;
+ const char * device   = NULL;
+ const char * server   = NULL;
+ const char * k;
  int    i;
  union {
Index: roarclients/roarpluginrunner.c
===================================================================
--- roarclients/roarpluginrunner.c	(revision 5518)
+++ roarclients/roarpluginrunner.c	(revision 5534)
@@ -420,5 +420,5 @@
  int ret = 0;
  int i;
- char * k;
+ const char * k;
 
  for (i = 1; i < argc; i++) {
Index: roarclients/roarradio.c
===================================================================
--- roarclients/roarradio.c	(revision 5533)
+++ roarclients/roarradio.c	(revision 5534)
@@ -53,6 +53,6 @@
 int main (int argc, char * argv[]) {
  struct roar_audio_info info;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  int    i;
  int    in = -1;
Index: roarclients/roarshout.c
===================================================================
--- roarclients/roarshout.c	(revision 5533)
+++ roarclients/roarshout.c	(revision 5534)
@@ -93,14 +93,14 @@
  enum { ARG, ASK, DSTR } pw_source = ARG;
  struct roar_audio_info info;
- char * server   = NULL;
- char * k;
- char * s_server = NULL;
- char * s_mount  = NULL;
+ const char * server   = NULL;
+ const char * k;
+ const char * s_server = NULL;
+ const char * s_mount  = NULL;
  char * s_pw     = NULL;
  int    s_port   = -1;
- char * s_desc   = NULL;
- char * s_genre  = NULL;
- char * s_name   = NULL;
- char * s_url    = NULL;
+ const char * s_desc   = NULL;
+ const char * s_genre  = NULL;
+ const char * s_name   = NULL;
+ const char * s_url    = NULL;
  int    s_public = 0;
  roar_vs_t * vss;
@@ -159,5 +159,5 @@
    s_port   = atoi(k);
   } else if ( s_pw     == NULL ) {
-   s_pw     = k;
+   s_pw     = argv[i]; // do not use k here so k can be const.
   } else if ( s_mount  == NULL ) {
    s_mount  = k;
Index: roarclients/roarsocktypes.c
===================================================================
--- roarclients/roarsocktypes.c	(revision 5381)
+++ roarclients/roarsocktypes.c	(revision 5534)
@@ -26,21 +26,22 @@
 #include <roaraudio.h>
 
+static const struct {
+ const char * name;
+ int (*func)(void);
+} tests[] = {
+ {"TCPv4"           , roar_socket_new_tcp },
+ {"UDPv4"           , roar_socket_new_udp },
+ {"TCPv6"           , roar_socket_new_tcp6},
+ {"UDPv6"           , roar_socket_new_udp6},
+ {"UNIX"            , roar_socket_new_unix},
+ {"DECnet seqpacket", roar_socket_new_decnet_seqpacket},
+ {"DECnet stream"   , roar_socket_new_decnet_stream},
+ {"IPX"             , roar_socket_new_ipx},
+ {"IPX/SPX"         , roar_socket_new_ipxspx},
+ {NULL, NULL}
+};
+
 int main (int argc, char * argv[]) {
  int i, fh;
- struct {
-  char * name;
-  int (*func)(void);
- } tests[] = {
-  {"TCPv4"           , roar_socket_new_tcp },
-  {"UDPv4"           , roar_socket_new_udp },
-  {"TCPv6"           , roar_socket_new_tcp6},
-  {"UDPv6"           , roar_socket_new_udp6},
-  {"UNIX"            , roar_socket_new_unix},
-  {"DECnet seqpacket", roar_socket_new_decnet_seqpacket},
-  {"DECnet stream"   , roar_socket_new_decnet_stream},
-  {"IPX"             , roar_socket_new_ipx},
-  {"IPX/SPX"         , roar_socket_new_ipxspx},
-  {NULL, NULL}
- };
 
  roar_debug_bin_obsolete(argv[0], NULL, NULL);
Index: roarclients/roartypes.c
===================================================================
--- roarclients/roartypes.c	(revision 5531)
+++ roarclients/roartypes.c	(revision 5534)
@@ -31,5 +31,5 @@
 
 int main (void) {
- struct { char * name; int len; } types[] = {
+ struct { const char * name; int len; } types[] = {
 //  { "roar_buffer",         sizeof(struct roar_buffer)         },
   { "roar_stack",          sizeof(struct roar_stack)          },
Index: roarclients/roarvio.c
===================================================================
--- roarclients/roarvio.c	(revision 5381)
+++ roarclients/roarvio.c	(revision 5534)
@@ -59,7 +59,7 @@
  int level = 0;
  int fh;
- char * name;
+ const char * name;
  const char * codec;
- char * content_type;
+ const char * content_type;
 
  while (cur != NULL) {
@@ -163,7 +163,7 @@
  ssize_t written = -1;
  int i;
- char * k;
- char * file0 = NULL;
- char * file1 = NULL;
+ const char * k;
+ const char * file0 = NULL;
+ const char * file1 = NULL;
  int o_flags = -1;
  int ret = 0;
Index: roarclients/roarvorbis.c
===================================================================
--- roarclients/roarvorbis.c	(revision 5381)
+++ roarclients/roarvorbis.c	(revision 5534)
@@ -97,5 +97,5 @@
                    roar_vs_t              ** vss,
                    OggVorbis_File         *  vf,
-                   char                   *  file,
+                   const char             *  file,
                    struct roar_audio_info *  info,
                    struct roar_vio_calls  *  vclt) {
@@ -288,8 +288,7 @@
  struct roar_vio_calls vclt, in;
  struct roar_vio_defaults def;
- char * server   = NULL;
- char * file     = NULL;
- char * vcltfile = NULL;
- char * k;
+ const char * file     = NULL;
+ const char * vcltfile = NULL;
+ const char * k;
  int    i;
  struct roar_connection con;
@@ -310,5 +309,5 @@
 
   if ( strcmp(k, "--server") == 0 ) {
-   server = argv[++i];
+   roar_libroar_set_server(argv[++i]);
   } else if ( strcmp(k, "--vclt-out") == 0 ) {
    vcltfile = argv[++i];
@@ -325,6 +324,4 @@
  }
 
- roar_libroar_set_server(server);
-
  if ( file == NULL ) {
   ROAR_ERR("No filename given.");
Index: roarclients/roarvumeter.c
===================================================================
--- roarclients/roarvumeter.c	(revision 5533)
+++ roarclients/roarvumeter.c	(revision 5534)
@@ -166,6 +166,6 @@
  struct roar_audio_info info;
  int    samples  = -1;
- char * server   = NULL;
- char * k;
+ const char * server   = NULL;
+ const char * k;
  struct roar_vio_calls stream, re;
  int    i;
