Changeset 5896:aef8b3923086 in roaraudio for libroar/vio_stream.c


Ignore:
Timestamp:
04/14/13 13:55:14 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

cleanup of usage of hard coded buffer lengths. Migrated some cases to usage of sizeof()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_stream.c

    r5823 r5896  
    159159static 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) { 
    160160 struct roar_libroar_config * config = roar_libroar_get_config(); 
    161  char file[80] = {0}; 
     161 char file[80] = ""; 
    162162 int fh = -1, listen = -1; 
    163163 static int count = 0; 
     
    217217 if ( sockname.type == ROAR_SOCKET_TYPE_DECNET ) { 
    218218  if ( roar_socket_get_local_nodename() ) { 
    219    snprintf(file, 24, "%s::roar$TMP%04x%02x", roar_socket_get_local_nodename(), getpid(), count++); 
     219   snprintf(file, sizeof(file), "%s::roar$TMP%04x%02x", roar_socket_get_local_nodename(), getpid(), count++); 
    220220  } else { 
    221221   return -1; 
Note: See TracChangeset for help on using the changeset viewer.