diff options
-rw-r--r-- | src/decoder/sidplay_decoder_plugin.cxx | 1 | ||||
-rw-r--r-- | src/main.c | 5 | ||||
-rw-r--r-- | src/output_list.c | 4 | ||||
-rw-r--r-- | src/rtsp_client.c | 14 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/decoder/sidplay_decoder_plugin.cxx b/src/decoder/sidplay_decoder_plugin.cxx index c4ef20496..5d162f179 100644 --- a/src/decoder/sidplay_decoder_plugin.cxx +++ b/src/decoder/sidplay_decoder_plugin.cxx @@ -201,7 +201,6 @@ get_song_length(const char *path_fs) static void sidplay_file_decode(struct decoder *decoder, const char *path_fs) { - int ret; int channels; /* load the tune */ diff --git a/src/main.c b/src/main.c index f7e7ba778..687e86f7e 100644 --- a/src/main.c +++ b/src/main.c @@ -258,10 +258,11 @@ initialize_decoder_and_player(void) param = config_get_param(CONF_AUDIO_BUFFER_SIZE); if (param != NULL) { - buffer_size = strtol(param->value, &test, 10); - if (*test != '\0' || buffer_size <= 0) + long tmp = strtol(param->value, &test, 10); + if (*test != '\0' || tmp <= 0 || tmp == LONG_MAX) MPD_ERROR("buffer size \"%s\" is not a positive integer, " "line %i\n", param->value, param->line); + buffer_size = tmp; } else buffer_size = DEFAULT_BUFFER_SIZE; diff --git a/src/output_list.c b/src/output_list.c index 6bb9b2f8b..e269086cf 100644 --- a/src/output_list.c +++ b/src/output_list.c @@ -106,8 +106,8 @@ audio_output_plugin_get(const char *name) const struct audio_output_plugin *plugin; audio_output_plugins_for_each(plugin, i) - if (strcmp(audio_output_plugins[i]->name, name) == 0) - return audio_output_plugins[i]; + if (strcmp(plugin->name, name) == 0) + return plugin; return NULL; } diff --git a/src/rtsp_client.c b/src/rtsp_client.c index 66b7244a2..ea993a163 100644 --- a/src/rtsp_client.c +++ b/src/rtsp_client.c @@ -486,35 +486,35 @@ exec_request(struct rtspcl_data *rtspcld, const char *cmd, if ( rtspcld->session != NULL ) { sprintf(reql,"Session: %s\r\n", rtspcld->session ); - strncat(req,reql,sizeof(req)); + g_strlcat(req, reql, sizeof(req)); } const struct key_data *hd_iter = hds; while (hd_iter) { sprintf(reql, "%s: %s\r\n", hd_iter->key, hd_iter->data); - strncat(req, reql, sizeof(req)); + g_strlcat(req, reql, sizeof(req)); hd_iter = hd_iter->next; } if (content_type && content) { sprintf(reql, "Content-Type: %s\r\nContent-Length: %d\r\n", content_type, (int) strlen(content)); - strncat(req,reql,sizeof(req)); + g_strlcat(req, reql, sizeof(req)); } sprintf(reql, "User-Agent: %s\r\n", rtspcld->useragent); - strncat(req, reql, sizeof(req)); + g_strlcat(req, reql, sizeof(req)); hd_iter = rtspcld->exthds; while (hd_iter) { sprintf(reql, "%s: %s\r\n", hd_iter->key, hd_iter->data); - strncat(req, reql, sizeof(req)); + g_strlcat(req, reql, sizeof(req)); hd_iter = hd_iter->next; } - strncat(req, "\r\n", sizeof(req)); + g_strlcat(req, "\r\n", sizeof(req)); if (content_type && content) - strncat(req, content, sizeof(req)); + g_strlcat(req, content, sizeof(req)); if (!tcp_socket_send(rtspcld->tcp_socket, req, strlen(req))) { g_set_error(error_r, rtsp_client_quark(), errno, |