bonsoir

j ai fait un code assez simple qui a pour but de recupere plusieurs informations dans une chaine de caracteres.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
char *get_info(char *info) {
     char *info_tmp;
     char *tmp;
 
     info_tmp = info;
 
     if (info_tmp == NULL) {
         return NULL;
     }
 
     tmp = strtok(info_tmp, " ");    
     printf("info : %s\n", tmp);
     if (tmp == NULL && strcmp(tmp, r) != 0) {
         printf("info invalid\n");
         return NULL;
     }
 
     return NULL;
}

Je ne sais pas d ou le probleme peut venir.

Merci.