Continued working on retrieving IP address from message

This commit is contained in:
2023-04-05 08:13:05 -05:00
parent eefe9fbf1b
commit 67466ade6e
2 changed files with 13 additions and 7 deletions

View File

@@ -4,14 +4,12 @@
char* fetch_address(char* message) {
char* token = malloc (sizeof(char) * strlen(message));
token = strtok(message," ");
token = strtok(message," \n");
if (strcmp(token,"TO:") == 0) {
token = strtok(NULL,"");
token = strtok(NULL," \n");
} else {
return NULL;
}
if (check_ip_ver(token) == -1) {
return NULL;
} else {
return token;
}
return token;
}