diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2009-11-22 09:39:33 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2009-11-22 09:39:33 +0200 |
commit | 2bcdff40140a64d5f03795f1792e9b2b13219e04 (patch) | |
tree | 9cceeaa27973f9c2ffb0d920e1672c427210e3f4 | |
parent | 2d7542698f91d0b2e398bef087d63ade769a994c (diff) |
modified: watrack_mpd/main.c
-rwxr-xr-x | watrack_mpd/main.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/watrack_mpd/main.c b/watrack_mpd/main.c index 37360b2..8424dc1 100755 --- a/watrack_mpd/main.c +++ b/watrack_mpd/main.c @@ -169,15 +169,18 @@ int Parser() return 1;
if (recvResult == SOCKET_ERROR)
return 1;
- strcpy(tmp, "password ");
- strcat(tmp, tmp2);
- strcat(tmp, "\n");
- Netlib_Send(ghConnection, tmp, strlen(tmp), 0);
- recvResult = CallService(MS_NETLIB_GETMOREPACKETS,(WPARAM)ghPacketReciever, (LPARAM)&nlpr);
- if(recvResult == 0)
- return 1;
- if (recvResult == SOCKET_ERROR)
- return 1;
+ if(strlen(tmp2) > 2)
+ {
+ strcpy(tmp, "password ");
+ strcat(tmp, tmp2);
+ strcat(tmp, "\n");
+ Netlib_Send(ghConnection, tmp, strlen(tmp), 0);
+ recvResult = CallService(MS_NETLIB_GETMOREPACKETS,(WPARAM)ghPacketReciever, (LPARAM)&nlpr);
+ if(recvResult == 0)
+ return 1;
+ if (recvResult == SOCKET_ERROR)
+ return 1;
+ }
mir_free(tmp2);
}
Netlib_Send(ghConnection, "status\n", strlen("status\n"), 0);
|