diff options
Diffstat (limited to 'client/data_decryption.c')
-rw-r--r-- | client/data_decryption.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/data_decryption.c b/client/data_decryption.c index 2d10561..b445454 100644 --- a/client/data_decryption.c +++ b/client/data_decryption.c @@ -4,6 +4,7 @@ #include <stdlib.h> #include <string.h> +#include <unistd.h> void decrypt_set_state(struct client *cl, char **end_p) { @@ -24,11 +25,9 @@ static void decrypt_set_trump_card(struct client *cl, char *start_p, { int i; - for(i = 0; *start_p != '\0'; ++start_p, ++i) + for(i = 0; *start_p != ':'; ++start_p, ++i) cl->trump_card[i] = *start_p; cl->trump_card[i] = '\0'; - /* move to : */ - ++start_p; *end_p = start_p; } @@ -65,7 +64,7 @@ void decrypt_set_base_info(struct client *cl, char *start_p, char **end_p) i = 0, j = 0; for(start_p = *end_p + 1; *start_p != ':'; ++start_p) { /* empty table */ - if(*start_p == '0') { + if(*start_p == '=') { /* to delimiter : */ ++start_p; i = -1; @@ -94,7 +93,7 @@ void decrypt_set_base_info(struct client *cl, char *start_p, char **end_p) for(++start_p, i = 0; *start_p != ':' && *start_p != '\n'; ++start_p) { /* empty deck */ - if(*start_p == '0') { + if(*start_p == '=') { i = -1; /* to delimiter ':' or '\n' */ ++start_p; @@ -107,6 +106,7 @@ void decrypt_set_base_info(struct client *cl, char *start_p, char **end_p) strcpy(card, tmp_card); push_stack(&cl->deck, card); i = 0; + continue; } tmp_card[i] = *start_p; ++i; @@ -132,7 +132,7 @@ void decrypt_set_card_queue(struct client *cl, char *start_p) for(i = 0, j = 0; *start_p != '\n'; ++start_p) { /* empty queue */ - if(*start_p == '0') { + if(*start_p == '=') { i = -1; break; } |