gnome: reqaccount: cleanup

This commit is contained in:
Tristan Matthews
2013-05-30 18:28:17 -04:00
parent 113e866a6d
commit 02db63c1ce
3 changed files with 9 additions and 8 deletions

View File

@ -528,8 +528,7 @@ void prefill_sip(void)
{
if (use_sflphone_org) {
char alias[300];
char *email;
email = (char *) gtk_entry_get_text(GTK_ENTRY(wiz->mailbox));
const char *email = gtk_entry_get_text(GTK_ENTRY(wiz->mailbox));
rest_account ra = get_rest_account(SFLPHONE_ORG_SERVER,email);
if (ra.success) {

View File

@ -49,7 +49,8 @@
#include "sflphone_const.h"
#include "reqaccount.h"
int req(char *host, int port, char request[], size_t request_size)
static int
req(const char *host, int port, char request[], size_t request_size)
{
int s;
struct sockaddr_in servSockAddr;
@ -122,11 +123,11 @@ int req(char *host, int port, char request[], size_t request_size)
return 0;
}
rest_account get_rest_account(char *host,char *email)
rest_account
get_rest_account(const char *host, const char *email)
{
char ret[4096];
rest_account ra = {0,};
bzero(ret, sizeof(ret));
char ret[4096] = {0};
rest_account ra = {0};
g_debug("HOST: %s", host);
strcpy(ret,"GET /rest/accountcreator?email=");
strncat(ret, email, sizeof(ret) - strlen(ret));

View File

@ -35,4 +35,5 @@ typedef struct {
char passwd[200];
} rest_account;
rest_account get_rest_account (char *host, char *email);
rest_account
get_rest_account(const char *host, const char *email);