Index: libroar/basic.c
===================================================================
--- libroar/basic.c	(revision 5895)
+++ libroar/basic.c	(revision 5896)
@@ -526,5 +526,5 @@
   if ( stat(ROAR_PROC_NET_DECNET, &decnet_stat) == 0 ) {
    if ( roar_socket_get_local_nodename() ) {
-    snprintf(user_sock, 79, "%s::%s", roar_socket_get_local_nodename(), ROAR_DEFAULT_OBJECT);
+    snprintf(user_sock, sizeof(user_sock)-1, "%s::%s", roar_socket_get_local_nodename(), ROAR_DEFAULT_OBJECT);
     if ( _connect_server(con, user_sock, ROAR_SOCKET_TYPE_DECNET, flags, timeout) == 0 )
      return 0;
Index: libroar/cdrom.c
===================================================================
--- libroar/cdrom.c	(revision 5895)
+++ libroar/cdrom.c	(revision 5896)
@@ -63,5 +63,5 @@
  if ( track != -1 ) {
   pos = my_pos;
-  snprintf(pos, 32, "%i", track);
+  snprintf(pos, sizeof(my_pos), "%i", track);
  }
 
Index: libroar/socket.c
===================================================================
--- libroar/socket.c	(revision 5895)
+++ libroar/socket.c	(revision 5896)
@@ -1081,5 +1081,5 @@
   return -1;
 
- if ( (len = snprintf(buf, 1024, "CONNECT %s:%i HTTP/1.0\r\nUser-Agent: libroar\r\n\r\n", host, port)) == -1 )
+ if ( (len = snprintf(buf, sizeof(buf), "CONNECT %s:%i HTTP/1.0\r\nUser-Agent: libroar\r\n\r\n", host, port)) == -1 )
   return -1;
 
@@ -1087,6 +1087,6 @@
   return -1;
 
- while ( (len = read(fh, buf, 1024)) ) {
-  if ( len == 1024 ) { // overlong lion
+ while ( (len = read(fh, buf, sizeof(buf))) ) {
+  if ( len == sizeof(buf) ) { // overlong lion
    return -1;
   } else if ( len == 2 && buf[0] == '\r' && buf[1] == '\n' ) {
@@ -1108,5 +1108,5 @@
  char * sep;
  char * bin_ssh;
- char   cmd[1024] = {0}, rcmd[1024] = {0};
+ char   cmd[1024] = "", rcmd[1024] = "";
  int    proxy_port = 22;
  int    use_socat = 0;
@@ -1152,13 +1152,13 @@
   if ( use_socat ) {
    if ( *host == '/' ) {
-    snprintf(rcmd, 1023, "socat stdio unix-connect:\"%s\"", host);
+    snprintf(rcmd, sizeof(rcmd)-1, "socat stdio unix-connect:\"%s\"", host);
    } else {
-    snprintf(rcmd, 1023, "socat stdio tcp:\"%s\":%i", host, port);
+    snprintf(rcmd, sizeof(rcmd)-1, "socat stdio tcp:\"%s\":%i", host, port);
    }
   } else {
-   snprintf(rcmd, 1023, "$(which netcat nc 2> /dev/null | grep -v \" \" | head -n 1) \"%s\" %i", host, port);
-  }
-
-  rcmd[1023] = 0;
+   snprintf(rcmd, sizeof(rcmd)-1, "$(which netcat nc 2> /dev/null | grep -v \" \" | head -n 1) \"%s\" %i", host, port);
+  }
+
+  rcmd[sizeof(rcmd)-1] = 0;
  }
 
@@ -1169,6 +1169,6 @@
   return -1;
 
- snprintf(cmd, 1023, "%s -p %i -l '%s' '%s' '%s'", bin_ssh, proxy_port, user, proxy_addr, rcmd);
- cmd[1023] = 0;
+ snprintf(cmd, sizeof(cmd)-1, "%s -p %i -l '%s' '%s' '%s'", bin_ssh, proxy_port, user, proxy_addr, rcmd);
+ cmd[sizeof(cmd)-1] = 0;
 
  roar_mm_free(bin_ssh);
Index: libroar/vio_cmd.c
===================================================================
--- libroar/vio_cmd.c	(revision 5895)
+++ libroar/vio_cmd.c	(revision 5896)
@@ -661,5 +661,5 @@
   }
 
-  snprintf(command, 1024, "%s --batch --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s %s", bin_gpg, pwpipe[0], para, opts);
+  snprintf(command, sizeof(command), "%s --batch --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s %s", bin_gpg, pwpipe[0], para, opts);
 
   write(pwpipe[1], pw, strlen(pw));
@@ -667,5 +667,5 @@
   close(pwpipe[1]);
  } else {
-  snprintf(command, 1024, "%s --no-verbose --quiet %s %s", bin_gpg, para, opts);
+  snprintf(command, sizeof(command), "%s --no-verbose --quiet %s %s", bin_gpg, para, opts);
  }
 
@@ -701,5 +701,5 @@
  char buf[1024];
 
- snprintf(buf, 1024, "-e -r %s", recipient);
+ snprintf(buf, sizeof(buf), "-e -r %s", recipient);
  return roar_vio_open_gpg(calls, dst, pw, 1, buf, options);
 }
Index: libroar/vio_stream.c
===================================================================
--- libroar/vio_stream.c	(revision 5823)
+++ libroar/vio_stream.c	(revision 5896)
@@ -159,5 +159,5 @@
 static int _roar_simple_new_stream_obj (struct roar_connection * con, struct roar_stream * s, uint32_t rate, uint32_t channels, uint32_t bits, uint32_t codec, int dir, int mixer) {
  struct roar_libroar_config * config = roar_libroar_get_config();
- char file[80] = {0};
+ char file[80] = "";
  int fh = -1, listen = -1;
  static int count = 0;
@@ -217,5 +217,5 @@
  if ( sockname.type == ROAR_SOCKET_TYPE_DECNET ) {
   if ( roar_socket_get_local_nodename() ) {
-   snprintf(file, 24, "%s::roar$TMP%04x%02x", roar_socket_get_local_nodename(), getpid(), count++);
+   snprintf(file, sizeof(file), "%s::roar$TMP%04x%02x", roar_socket_get_local_nodename(), getpid(), count++);
   } else {
    return -1;
Index: libroar/vio_string.c
===================================================================
--- libroar/vio_string.c	(revision 5823)
+++ libroar/vio_string.c	(revision 5896)
@@ -55,5 +55,5 @@
 
  va_start(ap, format);
- ret = vsnprintf(buf, 8192, format, ap);
+ ret = vsnprintf(buf, sizeof(buf), format, ap);
  va_end(ap);
 
