Skip to content
Snippets Groups Projects
Commit 02db63c1 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

gnome: reqaccount: cleanup

parent 113e866a
Branches
Tags
No related merge requests found
...@@ -528,8 +528,7 @@ void prefill_sip(void) ...@@ -528,8 +528,7 @@ void prefill_sip(void)
{ {
if (use_sflphone_org) { if (use_sflphone_org) {
char alias[300]; char alias[300];
char *email; const char *email = gtk_entry_get_text(GTK_ENTRY(wiz->mailbox));
email = (char *) gtk_entry_get_text(GTK_ENTRY(wiz->mailbox));
rest_account ra = get_rest_account(SFLPHONE_ORG_SERVER,email); rest_account ra = get_rest_account(SFLPHONE_ORG_SERVER,email);
if (ra.success) { if (ra.success) {
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
#include "sflphone_const.h" #include "sflphone_const.h"
#include "reqaccount.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; int s;
struct sockaddr_in servSockAddr; struct sockaddr_in servSockAddr;
...@@ -122,11 +123,11 @@ int req(char *host, int port, char request[], size_t request_size) ...@@ -122,11 +123,11 @@ int req(char *host, int port, char request[], size_t request_size)
return 0; 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]; char ret[4096] = {0};
rest_account ra = {0,}; rest_account ra = {0};
bzero(ret, sizeof(ret));
g_debug("HOST: %s", host); g_debug("HOST: %s", host);
strcpy(ret,"GET /rest/accountcreator?email="); strcpy(ret,"GET /rest/accountcreator?email=");
strncat(ret, email, sizeof(ret) - strlen(ret)); strncat(ret, email, sizeof(ret) - strlen(ret));
......
...@@ -35,4 +35,5 @@ typedef struct { ...@@ -35,4 +35,5 @@ typedef struct {
char passwd[200]; char passwd[200];
} rest_account; } rest_account;
rest_account get_rest_account (char *host, char *email); rest_account
get_rest_account(const char *host, const char *email);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment