From 6117cc8d4d9bfa911e0268fe1ddfc4386ba0eaec Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 20 Apr 2008 10:20:44 +0200 Subject: [PATCH] teamspeak2 plugin: Be case-insensitive when checking for errors. Apparently the error and okay messages may have different cases.. --- src/teamspeak2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/teamspeak2.c b/src/teamspeak2.c index 3bad6b0e..50e8d223 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -394,7 +394,7 @@ static int tss2_select_vserver (FILE *read_fh, FILE *write_fh, vserver_list_t *v response[sizeof (response)] = 0; /* Check answer */ - if ((strncmp ("OK", response, 2) == 0) + if ((strncasecmp ("OK", response, 2) == 0) && ((response[2] == 0) || (response[2] == '\n') || (response[2] == '\r'))) @@ -471,7 +471,7 @@ static int tss2_vserver_gapl (FILE *read_fh, FILE *write_fh, continue; } } - else if (strncmp ("OK", buffer, 2) == 0) + else if (strncasecmp ("OK", buffer, 2) == 0) { break; } @@ -573,13 +573,13 @@ static int tss2_read_vserver (vserver_list_t *vserver) break; } - if (strncmp ("ERROR", buffer, 5) == 0) + if (strncasecmp ("ERROR", buffer, 5) == 0) { ERROR ("teamspeak2 plugin: Server returned an error: %s", buffer); break; } - else if (strncmp ("OK", buffer, 2) == 0) + else if (strncasecmp ("OK", buffer, 2) == 0) { break; } -- 2.30.2