You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
320 B
C
18 lines
320 B
C
2 years ago
|
#include <easysock.h>
|
||
|
|
||
|
#include "message_helpers.h"
|
||
|
|
||
|
char* fetch_address(char* message) {
|
||
|
char* token = malloc (sizeof(char) * strlen(message));
|
||
|
token = strtok(message," ");
|
||
|
if (strcmp(token,"TO:") == 0) {
|
||
|
token = strtok(NULL,"");
|
||
|
}
|
||
|
|
||
|
if (check_ip_ver(token) == -1) {
|
||
|
return NULL;
|
||
|
} else {
|
||
|
return token;
|
||
|
}
|
||
|
}
|