diff options
author | Max Kellermann <max@duempel.org> | 2011-08-30 21:30:06 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-08-30 21:30:06 +0200 |
commit | 81d5c9757c66c1573dbec647834dead13b4bdf85 (patch) | |
tree | 74102cf2d2f0e2691bf07a72726a976f4a266ac6 /src | |
parent | f34124a50b4b8c753eea20005aab75605b15e870 (diff) | |
download | mpd-81d5c9757c66c1573dbec647834dead13b4bdf85.tar.gz mpd-81d5c9757c66c1573dbec647834dead13b4bdf85.tar.xz mpd-81d5c9757c66c1573dbec647834dead13b4bdf85.zip |
rtsp_client: check "new_kd" instead of "i"
Eliminate the redundant local variable "i".
Diffstat (limited to '')
-rw-r--r-- | src/rtsp_client.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/rtsp_client.c b/src/rtsp_client.c index d85a7632d..1a6304f49 100644 --- a/src/rtsp_client.c +++ b/src/rtsp_client.c @@ -348,7 +348,7 @@ exec_request(struct rtspcl_data *rtspcld, const char *cmd, char reql[128]; const char delimiters[] = " "; char *token, *dp; - int i,dsize = 0,rval; + int dsize = 0,rval; struct key_data *cur_kd = *kd; unsigned int j; int timeout = 5000; // msec unit @@ -438,10 +438,9 @@ exec_request(struct rtspcl_data *rtspcld, const char *cmd, } struct key_data *new_kd = NULL; - i = 0; while (read_line(rtspcld->fd, line, sizeof(line), timeout, 0) > 0) { timeout = 1000; // once it started, it shouldn't take a long time - if (i && line[0] == ' ') { + if (new_kd != NULL && line[0] == ' ') { for (j = 0; j < strlen(line); j++) if (line[j] != ' ') break; dsize += strlen(line + j); new_kd->data = g_realloc(new_kd->data, dsize); @@ -469,7 +468,6 @@ exec_request(struct rtspcl_data *rtspcld, const char *cmd, cur_kd->next = new_kd; cur_kd = new_kd; } - i++; } return true; } |