Fix Coverity Issues-2
[platform/core/api/sound-pool.git] / test / proxy / src / proxy.c
index 1719b75..a9c3afa 100644 (file)
@@ -680,7 +680,7 @@ static int __proxy_sound_pool_load_source_from_file(const char *pars)
 
        /* If tag wasn't specified by the user, we will use file path as a tag */
        if (tag[0] == '\0')
-               strncpy(tag, fname, MAX_PATH_LEN);
+               strncpy(tag, fname, MAX_PATH_LEN - 1);
 
        _logger_log_info(CMD_LOAD_SOURCE " command was called");
        _logger_log_info("Loading source to the pool with %zu identifier from %s file. "
@@ -1064,8 +1064,6 @@ static int __proxy_sound_pool_get_stream_state(const char *pars)
 /* CMD_SLEEP */
 static int __proxy_sleep(const char *pars)
 {
-       int ret = SOUND_POOL_ERROR_NONE;
-
        useconds_t stime = 0;
 
        if ((pars == NULL) || (sscanf(pars, " %u", &stime) < 1)) {
@@ -1080,7 +1078,7 @@ static int __proxy_sleep(const char *pars)
        usleep(stime);
        _logger_log_info("Main thread sleep has been finished...", stime);
 
-       return (ret == SOUND_POOL_ERROR_NONE ? OK : FAIL);
+       return OK;
 }
 
 /* CMD_EXECUTE_SCRIPT */