Changeset 0504f63 for functions.c


Ignore:
Timestamp:
Aug 10, 2008, 5:38:44 PM (13 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e9bb404
Parents:
d81f8d0
Message:
Rewrite owl_filter_print to use GString.

barnowl will no longer segfault on `show filter' with filters over
5000 characters or so.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rd81f8d0 r0504f63  
    25152515{
    25162516  owl_filter *f;
    2517   char buff[5000];
     2517  char *buff;
    25182518
    25192519  f=owl_global_get_filter(&g, name);
     
    25222522    return;
    25232523  }
    2524   owl_filter_print(f, buff);
     2524  buff = owl_filter_print(f);
    25252525  owl_function_popless_text(buff);
     2526  owl_free(buff);
    25262527}
    25272528
     
    25312532  owl_list *fl;
    25322533  char buff[5000];
     2534  char *tmp;
    25332535  owl_fmtext fm;
    25342536  int i, j;
     
    25442546    snprintf(buff, sizeof(buff), "[% 2d] ", i+1);
    25452547    owl_fmtext_append_normal(&fm, buff);
    2546     owl_filter_print(f, buff);
     2548    tmp = owl_filter_print(f);
     2549    owl_fmtext_append_normal(&fm, tmp);
     2550    owl_free(tmp);
    25472551    owl_fmtext_append_normal(&fm, buff);
    25482552  }
Note: See TracChangeset for help on using the changeset viewer.