Changeset 5896:aef8b3923086 in roaraudio
- Timestamp:
- 04/14/13 13:55:14 (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroar
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/basic.c
r5895 r5896 526 526 if ( stat(ROAR_PROC_NET_DECNET, &decnet_stat) == 0 ) { 527 527 if ( roar_socket_get_local_nodename() ) { 528 snprintf(user_sock, 79, "%s::%s", roar_socket_get_local_nodename(), ROAR_DEFAULT_OBJECT);528 snprintf(user_sock, sizeof(user_sock)-1, "%s::%s", roar_socket_get_local_nodename(), ROAR_DEFAULT_OBJECT); 529 529 if ( _connect_server(con, user_sock, ROAR_SOCKET_TYPE_DECNET, flags, timeout) == 0 ) 530 530 return 0; -
libroar/cdrom.c
r5895 r5896 63 63 if ( track != -1 ) { 64 64 pos = my_pos; 65 snprintf(pos, 32, "%i", track);65 snprintf(pos, sizeof(my_pos), "%i", track); 66 66 } 67 67 -
libroar/socket.c
r5895 r5896 1081 1081 return -1; 1082 1082 1083 if ( (len = snprintf(buf, 1024, "CONNECT %s:%i HTTP/1.0\r\nUser-Agent: libroar\r\n\r\n", host, port)) == -1 )1083 if ( (len = snprintf(buf, sizeof(buf), "CONNECT %s:%i HTTP/1.0\r\nUser-Agent: libroar\r\n\r\n", host, port)) == -1 ) 1084 1084 return -1; 1085 1085 … … 1087 1087 return -1; 1088 1088 1089 while ( (len = read(fh, buf, 1024)) ) {1090 if ( len == 1024) { // overlong lion1089 while ( (len = read(fh, buf, sizeof(buf))) ) { 1090 if ( len == sizeof(buf) ) { // overlong lion 1091 1091 return -1; 1092 1092 } else if ( len == 2 && buf[0] == '\r' && buf[1] == '\n' ) { … … 1108 1108 char * sep; 1109 1109 char * bin_ssh; 1110 char cmd[1024] = {0}, rcmd[1024] = {0};1110 char cmd[1024] = "", rcmd[1024] = ""; 1111 1111 int proxy_port = 22; 1112 1112 int use_socat = 0; … … 1152 1152 if ( use_socat ) { 1153 1153 if ( *host == '/' ) { 1154 snprintf(rcmd, 1023, "socat stdio unix-connect:\"%s\"", host);1154 snprintf(rcmd, sizeof(rcmd)-1, "socat stdio unix-connect:\"%s\"", host); 1155 1155 } else { 1156 snprintf(rcmd, 1023, "socat stdio tcp:\"%s\":%i", host, port);1156 snprintf(rcmd, sizeof(rcmd)-1, "socat stdio tcp:\"%s\":%i", host, port); 1157 1157 } 1158 1158 } else { 1159 snprintf(rcmd, 1023, "$(which netcat nc 2> /dev/null | grep -v \" \" | head -n 1) \"%s\" %i", host, port);1160 } 1161 1162 rcmd[ 1023] = 0;1159 snprintf(rcmd, sizeof(rcmd)-1, "$(which netcat nc 2> /dev/null | grep -v \" \" | head -n 1) \"%s\" %i", host, port); 1160 } 1161 1162 rcmd[sizeof(rcmd)-1] = 0; 1163 1163 } 1164 1164 … … 1169 1169 return -1; 1170 1170 1171 snprintf(cmd, 1023, "%s -p %i -l '%s' '%s' '%s'", bin_ssh, proxy_port, user, proxy_addr, rcmd);1172 cmd[ 1023] = 0;1171 snprintf(cmd, sizeof(cmd)-1, "%s -p %i -l '%s' '%s' '%s'", bin_ssh, proxy_port, user, proxy_addr, rcmd); 1172 cmd[sizeof(cmd)-1] = 0; 1173 1173 1174 1174 roar_mm_free(bin_ssh); -
libroar/vio_cmd.c
r5895 r5896 661 661 } 662 662 663 snprintf(command, 1024, "%s --batch --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s %s", bin_gpg, pwpipe[0], para, opts);663 snprintf(command, sizeof(command), "%s --batch --no-verbose --quiet --passphrase-repeat 0 --passphrase-fd %i %s %s", bin_gpg, pwpipe[0], para, opts); 664 664 665 665 write(pwpipe[1], pw, strlen(pw)); … … 667 667 close(pwpipe[1]); 668 668 } else { 669 snprintf(command, 1024, "%s --no-verbose --quiet %s %s", bin_gpg, para, opts);669 snprintf(command, sizeof(command), "%s --no-verbose --quiet %s %s", bin_gpg, para, opts); 670 670 } 671 671 … … 701 701 char buf[1024]; 702 702 703 snprintf(buf, 1024, "-e -r %s", recipient);703 snprintf(buf, sizeof(buf), "-e -r %s", recipient); 704 704 return roar_vio_open_gpg(calls, dst, pw, 1, buf, options); 705 705 } -
libroar/vio_stream.c
r5823 r5896 159 159 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) { 160 160 struct roar_libroar_config * config = roar_libroar_get_config(); 161 char file[80] = {0};161 char file[80] = ""; 162 162 int fh = -1, listen = -1; 163 163 static int count = 0; … … 217 217 if ( sockname.type == ROAR_SOCKET_TYPE_DECNET ) { 218 218 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++); 220 220 } else { 221 221 return -1; -
libroar/vio_string.c
r5823 r5896 55 55 56 56 va_start(ap, format); 57 ret = vsnprintf(buf, 8192, format, ap);57 ret = vsnprintf(buf, sizeof(buf), format, ap); 58 58 va_end(ap); 59 59
Note: See TracChangeset
for help on using the changeset viewer.