Changeset 1c6c4d3 for functions.c


Ignore:
Timestamp:
Jun 30, 2002, 4:58:09 PM (19 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
507d5aa
Parents:
262422c
Message:
	Added owl_sprintf which returns the formatted string, or NULL.
	        The caller must free this string.
		This will allocate enough memory and thus
		avoid potential some buffer overrun situations.
	Started fixing some potential buffer overrun situations.
	Simple implementation of 'zwrite -m' (doesn't yet log an outgoing
	        message as having been sent.)
	The "Not logged in or subscribing to messages" error
	        now includes the name of the recipient.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rd36f2cb r1c6c4d3  
    155155  /* display the message as an admin message in the receive window */
    156156  if (owl_global_is_displayoutgoing(&g) && owl_zwrite_is_personal(&z)) {
    157     tmpbuff=owl_malloc(strlen(owl_editwin_get_text(owl_global_get_typwin(&g)))+1024);
    158157    owl_zwrite_get_recipstr(&z, buff);
    159     sprintf(tmpbuff, "Message sent to %s", buff);
     158    tmpbuff = owl_sprintf("Message sent to %s", buff);
    160159    owl_function_adminmsg_outgoing(tmpbuff, owl_editwin_get_text(owl_global_get_typwin(&g)), line);
    161160    owl_free(tmpbuff);
     
    11621161  }
    11631162
    1164   buff=malloc(num*200);
     1163  buff=owl_malloc(num*200);
    11651164  strcpy(buff, "");
    11661165  for (i=0; i<num; i++) {
     
    11731172
    11741173  owl_function_popless_text(buff);
    1175   free(buff);
     1174  owl_free(buff);
    11761175  ZFlushSubscriptions();
    11771176}
     
    12661265  owl_view *v;
    12671266  owl_filter *f;
    1268   char buff[LINE];
    12691267
    12701268  /* get the trash filter */
     
    12871285  }
    12881286  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    1289   sprintf(buff, "%i messages marked for deletion", count);
    1290   owl_function_makemsg(buff);
     1287  owl_function_makemsg("%i messages marked for deletion", count);
    12911288  owl_global_set_needrefresh(&g);
    12921289}
Note: See TracChangeset for help on using the changeset viewer.