summaryrefslogtreecommitdiffstats
path: root/friendfinder/sender.c
diff options
context:
space:
mode:
authorPatrick Hornecker2010-02-18 19:11:15 +0100
committerPatrick Hornecker2010-02-18 19:11:15 +0100
commit88bb54e30a038269e33fd3b14f3bf321f0cb96c8 (patch)
tree7bf54973611ac14d974f9a07a6cff87093dae706 /friendfinder/sender.c
parenttex source (diff)
downloadfriendfinder-88bb54e30a038269e33fd3b14f3bf321f0cb96c8.tar.gz
friendfinder-88bb54e30a038269e33fd3b14f3bf321f0cb96c8.tar.xz
friendfinder-88bb54e30a038269e33fd3b14f3bf321f0cb96c8.zip
tex source
Diffstat (limited to 'friendfinder/sender.c')
-rw-r--r--friendfinder/sender.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/friendfinder/sender.c b/friendfinder/sender.c
index b9557e8..1d157cb 100644
--- a/friendfinder/sender.c
+++ b/friendfinder/sender.c
@@ -84,11 +84,11 @@ struct sender_data* prepare_position(const unsigned char* lat, const unsigned ch
{
struct sender_data *pos = (struct sender_data*) malloc(sizeof(struct sender_data));
- pos->lat_first = (char*) malloc(sizeof(char) * 5);
- pos->lat_second = (char*) malloc(sizeof(char) * 5);
+ pos->lat_first = (char*) malloc(sizeof(char) * 8);
+ pos->lat_second = (char*) malloc(sizeof(char) * 8);
- pos->lon_first = (char*) malloc(sizeof(char) * 5);
- pos->lon_second = (char*) malloc(sizeof(char) * 5);
+ pos->lon_first = (char*) malloc(sizeof(char) * 8);
+ pos->lon_second = (char*) malloc(sizeof(char) * 8);
for (int i = 0; i < 9; i++)
{
@@ -131,11 +131,18 @@ struct sender_data* prepare_position(const unsigned char* lat, const unsigned ch
void send_position(irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count)
{
- unsigned char *crypted_lat_first = (char*) malloc(sizeof(char) * 8);
- unsigned char *crypted_lat_second = (char*) malloc(sizeof(char) * 8);
+ unsigned char *crypted_lat_first = (char*) malloc(sizeof(char) * 9);
+ crypted_lat_first[0] = '\0';
+
+ unsigned char *crypted_lat_second = (char*) malloc(sizeof(char) * 9);
+ crypted_lat_second[0] = '\0';
+
+ unsigned char *crypted_lon_first = (char*) malloc(sizeof(char) * 9);
+ crypted_lon_first[0] = '\0';
+
+ unsigned char *crypted_lon_second = (char*) malloc(sizeof(char) * 9);
+ crypted_lon_second[0] = '\0';
- unsigned char *crypted_lon_first = (char*) malloc(sizeof(char) * 8);
- unsigned char *crypted_lon_second = (char*) malloc(sizeof(char) * 8);
if (first_send == 0)
{
@@ -157,10 +164,10 @@ void send_position(irc_session_t * session, const char * event, const char * ori
if (exit_ == 1)
disconnect_sender();
- const unsigned char *lat_char = (char*) malloc(sizeof(char) * 9);
+ const unsigned char *lat_char = (char*) malloc(sizeof(char) * 10);
sprintf(lat_char, "%f", own_lat);
- const unsigned char *lon_char = (char*) malloc(sizeof(char) * 9);
+ const unsigned char *lon_char = (char*) malloc(sizeof(char) * 10);
sprintf(lon_char, "%f", own_lon);
struct sender_data *pos = (struct sender_data*) malloc(sizeof(struct sender_data));
@@ -223,7 +230,7 @@ void get_aknowledge(irc_session_t * session, const char * event, const char * or
{
resend = 1;
- sleep(5);
+ //sleep(3);
send_position(session, event, origin, params, count);
}