summaryrefslogtreecommitdiffstats
path: root/friendfinder/sender.c
diff options
context:
space:
mode:
Diffstat (limited to 'friendfinder/sender.c')
-rw-r--r--friendfinder/sender.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/friendfinder/sender.c b/friendfinder/sender.c
index 8cf0cfb..3f9c683 100644
--- a/friendfinder/sender.c
+++ b/friendfinder/sender.c
@@ -68,12 +68,15 @@ void send_position(irc_session_t * session, const char * event, const char * ori
if (first_send == 0)
{
- char *_key = read_key();
+ char *_key = (char*) malloc(sizeof(char) * 300);
+ _key = read_key();
BF_set_key(&key, strlen(_key) - 1, _key);
irc_cmd_join(session, "#test", NULL);
irc_cmd_msg(session, "#test", "connected");
+
+ first_send = 1;
}
unsigned char lat_char[16];
@@ -85,8 +88,10 @@ void send_position(irc_session_t * session, const char * event, const char * ori
BF_ecb_encrypt(lat_char, crypted_lat, &key, BF_ENCRYPT);
BF_ecb_encrypt(lon_char, crypted_lon, &key, BF_ENCRYPT);
- int _x = irc_cmd_msg(session, "#test", crypted_lat);
- int _y = irc_cmd_msg(session, "#test", crypted_lon);
+ int _x = NULL;
+ _x = irc_cmd_msg(session, "#test", crypted_lat);
+ int _y = NULL;
+ _y = irc_cmd_msg(session, "#test", crypted_lon);
//increase counter variable, which counts number of send positions!
msg_count = msg_count + 2;
@@ -106,8 +111,6 @@ void send_position(irc_session_t * session, const char * event, const char * ori
printf("SENDER: error code due sending: %i \n", _x);
}
- first_send = 1;
-
if(resend == 1)
{
get_aknowledge(session, event, origin, params, count);