cin34
Member
- Jan 23, 2016
- 32
- 15
- 58
Hi, I have a problem replacing the characters in the id.
I would like to replace "+" with "%% 2B".
My code:
Will anyone help me?
Thanks.
I would like to replace "+" with "%% 2B".
My code:
Code:
void ts3plugin_infoData(uint64 serverConnectionHandlerID, uint64 id, enum PluginItemType type, char** data) {
char* name;
char* uid;
switch(type) {
break;
case PLUGIN_CLIENT:
if(ts3Functions.getClientVariableAsString(serverConnectionHandlerID, (anyID)id, CLIENT_NICKNAME, &name) != ERROR_ok) {
printf("Error getting client nickname\n");
return;
}
if (ts3Functions.getClientVariableAsString(serverConnectionHandlerID, (anyID)id, CLIENT_UNIQUE_IDENTIFIER, &uid) != ERROR_ok) {
printf("Error getting client identifier\n");
return;
}
break;
default:
printf("Invalid item type: %d\n", type);
data = NULL; /* Ignore */
return;
}
*data = (char*)malloc(INFODATA_BUFSIZE * sizeof(char));
char *c = str_replace("+", "test", uid);
snprintf(*data, INFODATA_BUFSIZE, "Client mysite: [URL=http://mysite.com/?page=searchclient&uid=%s]\"%s\"[/URL]", c, name);
ts3Functions.freeMemory(name);
ts3Functions.freeMemory(uid);
}
Thanks.