Changeset af2ca19 for fmtext.c


Ignore:
Timestamp:
Sep 16, 2002, 6:13:41 PM (22 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
62f24bc
Parents:
42abb10
Message:
Fixed memory leak and buffer overrun in fmtext
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r4b464a4 raf2ca19  
    396396  char *ptr1, *ptr2;
    397397  int i, offset;
    398 
    399   /* initialize out */
    400   owl_fmtext_init_null(out);
    401398 
    402399  /* find the starting line */
     
    436433  /* the message is expected to end in a new line for now */
    437434
    438   owl_fmtext_init_null(out);
    439 
    440435  last=in->textbuff+in->textlen-1;
    441436  ptr1=in->textbuff;
     
    478473  int lines, i;
    479474
     475  if (f->textlen==0) return(0);
     476 
    480477  lines=0;
    481   for (i=0; f->textbuff[i]!='\0'; i++) {
     478  for (i=0; i<f->textlen; i++) {
    482479    if (f->textbuff[i]=='\n') lines++;
    483480  }
Note: See TracChangeset for help on using the changeset viewer.