Changeset e3a75ed
- Timestamp:
- Mar 5, 2011, 3:25:29 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 488913a
- Parents:
- 010a951
- git-author:
- David Benjamin <davidben@mit.edu> (02/28/11 18:45:28)
- git-committer:
- David Benjamin <davidben@mit.edu> (03/05/11 15:25:29)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r010a951 re3a75ed 2258 2258 const owl_filter *f; 2259 2259 const owl_list *fl; 2260 char buff[5000];2261 2260 char *tmp; 2262 2261 owl_fmtext fm; … … 2271 2270 for (i=0; i<j; i++) { 2272 2271 f=owl_list_get_element(fl, i); 2273 snprintf(buff, sizeof(buff), "[% 2d] ", i+1); 2274 owl_fmtext_append_normal(&fm, buff); 2272 owl_fmtext_appendf_normal(&fm, "[% 2d] ", i+1); 2275 2273 tmp = owl_filter_print(f); 2276 2274 owl_fmtext_append_normal(&fm, tmp); -
logging.c
r60d7935 re3a75ed 126 126 void owl_log_outgoing(const owl_message *m) 127 127 { 128 char filename[MAXPATHLEN], *logpath;128 char *filename, *logpath; 129 129 char *to, *temp; 130 130 GList *cc; … … 139 139 while (cc != NULL) { 140 140 temp = short_zuser(cc->data); 141 snprintf(filename, MAXPATHLEN,"%s/%s", logpath, temp);141 filename = g_strdup_printf("%s/%s", logpath, temp); 142 142 owl_log_append(m, filename); 143 143 144 g_free(filename); 144 145 g_free(temp); 145 146 g_free(cc->data); … … 162 163 } 163 164 164 snprintf(filename, MAXPATHLEN,"%s/%s", logpath, to);165 filename = g_strdup_printf("%s/%s", logpath, to); 165 166 owl_log_append(m, filename); 166 167 g_free(to); 167 168 snprintf(filename, MAXPATHLEN, "%s/all", logpath); 168 g_free(filename); 169 170 filename = g_strdup_printf("%s/all", logpath); 169 171 owl_log_append(m, filename); 170 172 g_free(logpath); 173 g_free(filename); 171 174 } 172 175 … … 175 178 { 176 179 FILE *file; 177 char filename[MAXPATHLEN], *logpath;180 char *filename, *logpath; 178 181 char *tobuff; 179 182 owl_message *m; … … 196 199 logpath = owl_util_makepath(owl_global_get_logpath(&g)); 197 200 198 snprintf(filename, MAXPATHLEN,"%s/%s", logpath, tobuff);201 filename = g_strdup_printf("%s/%s", logpath, tobuff); 199 202 file=fopen(filename, "a"); 203 g_free(filename); 200 204 if (!file) { 201 205 owl_function_error("Unable to open file for outgoing logging"); … … 210 214 fclose(file); 211 215 212 snprintf(filename, MAXPATHLEN,"%s/all", logpath);216 filename = g_strdup_printf("%s/all", logpath); 213 217 g_free(logpath); 214 218 file=fopen(filename, "a"); 219 g_free(filename); 215 220 if (!file) { 216 221 owl_function_error("Unable to open file for outgoing logging"); … … 229 234 void owl_log_incoming(const owl_message *m) 230 235 { 231 char filename[MAXPATHLEN], allfilename[MAXPATHLEN], *logpath;236 char *filename, *allfilename, *logpath; 232 237 const char *from=NULL; 233 238 char *frombuff=NULL; … … 311 316 if (personal) { 312 317 logpath = owl_util_makepath(owl_global_get_logpath(&g)); 313 snprintf(filename, MAXPATHLEN,"%s/%s", logpath, from);314 snprintf(allfilename, MAXPATHLEN,"%s/all", logpath);318 filename = g_strdup_printf("%s/%s", logpath, from); 319 allfilename = g_strdup_printf("%s/all", logpath); 315 320 owl_log_append(m, allfilename); 316 321 g_free(allfilename); 317 322 } else { 318 323 logpath = owl_util_makepath(owl_global_get_classlogpath(&g)); 319 snprintf(filename, MAXPATHLEN,"%s/%s", logpath, from);324 filename = g_strdup_printf("%s/%s", logpath, from); 320 325 } 321 326 322 327 owl_log_append(m, filename); 328 g_free(filename); 323 329 324 330 if (personal && owl_message_is_type_zephyr(m)) { … … 332 338 temp = short_zuser(cc->data); 333 339 if (strcasecmp(temp, frombuff) != 0) { 334 snprintf(filename, MAXPATHLEN,"%s/%s", logpath, temp);340 filename = g_strdup_printf("%s/%s", logpath, temp); 335 341 owl_log_append(m, filename); 342 g_free(filename); 336 343 } 337 344 -
zephyr.c
rbb85767 re3a75ed 762 762 } 763 763 } else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) { 764 #define BUFFLEN 1024765 764 if (retnotice->z_recipient == NULL 766 765 || *retnotice->z_recipient == 0 767 766 || *retnotice->z_recipient == '@') { 768 char buff[BUFFLEN];767 char *buff; 769 768 owl_function_error("No one subscribed to class %s", retnotice->z_class); 770 snprintf(buff, BUFFLEN,"Could not send message to class %s: no one subscribed.\n", retnotice->z_class);769 buff = g_strdup_printf("Could not send message to class %s: no one subscribed.\n", retnotice->z_class); 771 770 owl_function_adminmsg("", buff); 771 g_free(buff); 772 772 } else { 773 char buff[BUFFLEN];773 char *buff; 774 774 owl_zwrite zw; 775 775 char *realm; … … 783 783 */ 784 784 if(strcasecmp(retnotice->z_class, "message")) { 785 snprintf(buff, BUFFLEN,785 buff = g_strdup_printf( 786 786 "Could not send message to %s: " 787 787 "not logged in or subscribing to class %s, instance %s.\n", … … 790 790 retnotice->z_class_inst); 791 791 } else if(strcasecmp(retnotice->z_class_inst, "personal")) { 792 snprintf(buff, BUFFLEN,792 buff = g_strdup_printf( 793 793 "Could not send message to %s: " 794 794 "not logged in or subscribing to instance %s.\n", … … 796 796 retnotice->z_class_inst); 797 797 } else { 798 snprintf(buff, BUFFLEN,798 buff = g_strdup_printf( 799 799 "Could not send message to %s: " 800 800 "not logged in or subscribing to messages.\n", … … 820 820 821 821 owl_zwrite_cleanup(&zw); 822 g_free(buff); 822 823 g_free(tmp); 823 824 }
Note: See TracChangeset
for help on using the changeset viewer.