/[imapfilter]/imapfilter/data.c
ViewVC logotype

Diff of /imapfilter/data.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by lefcha, Mon Oct 1 19:19:05 2001 UTC revision 1.6 by lefcha, Tue Oct 2 07:31:52 2001 UTC
# Line 24  static filter_t *cur_fltr = NULL;      /* Cur Line 24  static filter_t *cur_fltr = NULL;      /* Cur
24    
25    
26  /*  /*
  * Allocate memory of the appropriate size for a new node.  
  */  
 void *create_node(size_t size)  
 {  
     void *ptr;  
   
     ptr = (void *) malloc(size);  
   
     if (!ptr)  
         fatal(ERROR_MEMORY_ALLOCATION,  
               "imapfilter: allocating memory; %s\n", strerror(errno));  
   
     return ptr;  
 }  
   
   
 /*  
27   * Set new account's variables to safe values.   * Set new account's variables to safe values.
28   */   */
29  void init_account(account_t * node)  void init_account(account_t * node)
# Line 478  int set_job(char *line, regmatch_t * mat Line 461  int set_job(char *line, regmatch_t * mat
461          return ERROR_CONFIG_PARSE;          return ERROR_CONFIG_PARSE;
462    
463      s = match[1].rm_eo - match[1].rm_so;      s = match[1].rm_eo - match[1].rm_so;
464      fltr = (char *) malloc(s + 1);      fltr = (char *) xmalloc(s + 1);
   
     if (!fltr)  
         fatal(ERROR_MEMORY_ALLOCATION, "imapfilter: allocating memory; %s",  
               strerror(errno));  
465    
466      f = strncpy(fltr, line + match[1].rm_so, s);      f = strncpy(fltr, line + match[1].rm_so, s);
467      f[s] = 0;      f[s] = 0;
468    
469      s = match[2].rm_eo - match[2].rm_so;      s = match[2].rm_eo - match[2].rm_so;
470      mbgrp = (char *) malloc(s + 1);      mbgrp = (char *) xmalloc(s + 1);
   
     if (!mbgrp)  
         fatal(ERROR_MEMORY_ALLOCATION, "imapfilter: allocating memory; %s",  
               strerror(errno));  
471    
472      /* Go through filters. */      /* Go through filters. */
473      while ((ftok = strsep(&f, delim))) {      while ((ftok = strsep(&f, delim))) {
# Line 583  void string_upper(char *str, size_t size Line 558  void string_upper(char *str, size_t size
558      int i;      int i;
559    
560      for (i = 0; i < size; i++)      for (i = 0; i < size; i++)
561          *(str + i) = toupper(*(str + i));          if (islower(*(str + i)))
562                *(str + i) = toupper(*(str + i));
563  }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26