summaryrefslogtreecommitdiff
path: root/testing/toxic
diff options
context:
space:
mode:
Diffstat (limited to 'testing/toxic')
-rw-r--r--testing/toxic/main.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/testing/toxic/main.c b/testing/toxic/main.c
index 05fabe4c..72d8633b 100644
--- a/testing/toxic/main.c
+++ b/testing/toxic/main.c
@@ -27,7 +27,7 @@
27 27
28/* Export for use in Callbacks */ 28/* Export for use in Callbacks */
29char *DATA_FILE = NULL; 29char *DATA_FILE = NULL;
30char dir[31]; 30char dir[256];
31 31
32void on_window_resize(int sig) 32void on_window_resize(int sig)
33{ 33{
@@ -38,13 +38,13 @@ void on_window_resize(int sig)
38 38
39void setdir() 39void setdir()
40{ 40{
41 #ifdef WIN32 41#ifdef WIN32
42 strcpy(dir, "%appdata%/.tox/"); 42 strcpy(dir, "%appdata%/.tox/");
43 #elif defined(MAC_OSX) 43#elif defined(MAC_OSX)
44 strcpy(dir, "~/Library/Application Support/.tox/"); 44 strcpy(dir, "~/Library/Application Support/.tox/");
45 #elif defined(linux) 45#elif defined(linux)
46 strcpy(dir, "~/.tox/"); 46 strcpy(dir, "~/.tox/");
47 #endif 47#endif
48} 48}
49 49
50static void init_term() 50static void init_term()
@@ -84,15 +84,15 @@ static Messenger *init_tox()
84 m_callback_namechange(m, on_nickchange, NULL); 84 m_callback_namechange(m, on_nickchange, NULL);
85 m_callback_statusmessage(m, on_statuschange, NULL); 85 m_callback_statusmessage(m, on_statuschange, NULL);
86 m_callback_action(m, on_action, NULL); 86 m_callback_action(m, on_action, NULL);
87 #ifdef __linux__ 87#ifdef __linux__
88 setname(m, (uint8_t *) "Cool guy", sizeof("Cool guy")); 88 setname(m, (uint8_t *) "Cool guy", sizeof("Cool guy"));
89 #elif defined(WIN32) 89#elif defined(WIN32)
90 setname(m, (uint8_t *) "I should install GNU/Linux", sizeof("I should install GNU/Linux")); 90 setname(m, (uint8_t *) "I should install GNU/Linux", sizeof("I should install GNU/Linux"));
91 #elif defined(MAC_OSX) 91#elif defined(MAC_OSX)
92 setname(m, (uint8_t *) "Hipster", sizeof("Hipster")); //This used to users of other Unixes are hipsters 92 setname(m, (uint8_t *) "Hipster", sizeof("Hipster")); //This used to users of other Unixes are hipsters
93 #else 93#else
94 setname(m, (uint8_t *) "Registered Minix user #4", sizeof("Registered Minix user #4")); 94 setname(m, (uint8_t *) "Registered Minix user #4", sizeof("Registered Minix user #4"));
95 #endif 95#endif
96 return m; 96 return m;
97} 97}
98 98
@@ -106,13 +106,13 @@ int init_connection(void)
106 if (DHT_isconnected()) 106 if (DHT_isconnected())
107 return 0; 107 return 0;
108 108
109 #if WIN32 109#if WIN32
110 FILE *fp = fopen("%appdata%/.tox/DHTservers", "r"); 110 FILE *fp = fopen("%appdata%/.tox/DHTservers", "r");
111 #elif MAC_OSX 111#elif MAC_OSX
112 FILE *fp = fopen("~/Library/Application Support/.tox/DHTservers", "r"); 112 FILE *fp = fopen("~/Library/Application Support/.tox/DHTservers", "r");
113 #else 113#else
114 FILE *fp = fopen("~/.tox/DHTservers", "r"); 114 FILE *fp = fopen("~/.tox/DHTservers", "r");
115 #endif 115#endif
116 116
117 if (!fp) 117 if (!fp)
118 return 1; 118 return 1;
@@ -309,7 +309,7 @@ int main(int argc, char *argv[])
309 strcat(DATA_FILE, dir); 309 strcat(DATA_FILE, dir);
310 DATA_FILE = strdup("data"); 310 DATA_FILE = strdup("data");
311 311
312 312
313 } else { 313 } else {
314 DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1); 314 DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1);
315 strcpy(DATA_FILE, user_config_dir); 315 strcpy(DATA_FILE, user_config_dir);