Changeset 22 for trunk/src/sh_mail.c


Ignore:
Timestamp:
Feb 23, 2006, 12:03:58 AM (19 years ago)
Author:
rainer
Message:

Minor code revisions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_mail.c

    r20 r22  
    271271
    272272static
    273 int sh_filter_filteradd (char * argstring, sh_filter_type * filter, int ftype)
     273int sh_filter_filteradd (const char * argstring,
     274                         sh_filter_type * filter, int ftype)
    274275{
    275276  int     i = 0;
     
    372373 */
    373374static
    374 int sh_filter_filter (char * message, sh_filter_type * filter)
     375int sh_filter_filter (const char * message, sh_filter_type * filter)
    375376{
    376377  int i;
     
    432433 * -- add keywords to the OR filter
    433434 */
    434 int sh_mail_add_or (char * str)
     435int sh_mail_add_or (const char * str)
    435436{
    436437  return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_OR));
     
    440441 * -- add keywords to the AND filter
    441442 */
    442 int sh_mail_add_and (char * str)
     443int sh_mail_add_and (const char * str)
    443444{
    444445  return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_AND));
     
    448449 * -- add keywords to the NOT filter
    449450 */
    450 int sh_mail_add_not (char * str)
     451int sh_mail_add_not (const char * str)
    451452{
    452453  return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_NOT));
     
    473474}
    474475
    475 int sh_mail_setaddress (char * address)
     476int sh_mail_setaddress (const char * address)
    476477{
    477478  char     *     p;
     
    523524}
    524525
    525 int sh_mail_setaddress_int (char * address)
     526int sh_mail_setaddress_int (const char * address)
    526527{
    527528  int i;
     
    533534}
    534535
    535 int sh_mail_setNum (char * str)
     536int sh_mail_setNum (const char * str)
    536537{
    537538  int i = atoi (str);
     
    549550static int all_in_one = S_FALSE;
    550551
    551 int sh_mail_setFlag (char * str)
     552int sh_mail_setFlag (const char * str)
    552553{
    553554  int i;
     
    559560static char * mail_subject = NULL;
    560561
    561 int set_mail_subject (char * str)
     562int set_mail_subject (const char * str)
    562563{
    563564  SL_ENTER(_("set_mail_subject"));
     
    10061007        /* reveal first signature key
    10071008         */
    1008         (void) sl_strlcpy(skey->crypt, skey->mailkey_new, KEY_LEN+1);
     1009        /* flawfinder: ignore */
     1010        (void) sl_strlcpy(skey->crypt, skey->mailkey_new, KEY_LEN+1);
    10091011
    10101012        BREAKEXIT(sh_util_encode);
     1013        /* flawfinder: ignore */
    10111014        sh_util_encode(skey->crypt, bufcompress, 0, 'A');
    10121015
     1016        /* flawfinder: ignore */
    10131017        (void) sl_strlcat (mailMsg, skey->crypt, msgbufsize);
     1018        /* flawfinder: ignore */
    10141019        memset (skey->crypt, 0, KEY_LEN);
    10151020        isfirst = 0;
     
    10211026    (void) sl_strlcpy (skey->mailkey_old, skey->mailkey_new, KEY_LEN+1);
    10221027
    1023     /*@-bufferoverflowhigh@*/
    1024     sprintf(subject, _("%06d %010ld::%s\r\n"),         /* known to fit  */
    1025             mailcount, (long) id_audit, sh.host.name);
    1026     /*@+bufferoverflowhigh@*/
     1028    sl_snprintf(subject, sizeof(subject), _("%06d %010ld::%s\r\n"),
     1029                mailcount, (long) id_audit, sh.host.name);
    10271030
    10281031    (void) sl_strlcat (mailMsg, subject, msgbufsize);
     
    12221225static char * relay_host = NULL;
    12231226
    1224 int sh_mail_set_relay (char * str_s)
     1227int sh_mail_set_relay (const char * str_s)
    12251228{
    12261229  size_t i = 0;
     
    12511254static char * mail_sender = NULL;
    12521255
    1253 int sh_mail_set_sender (char *str)
     1256int sh_mail_set_sender (const char *str)
    12541257{
    12551258  if (mail_sender != NULL)
     
    17351738      if (g != 1)
    17361739        {
    1737           /*@-bufferoverflowhigh@*/
    1738           sprintf(errmsg,                              /* known to fit  */
    1739                   _("Bad response (%d), expected %d"), rcode, code);
    1740           /*@+bufferoverflowhigh@*/
     1740          sl_snprintf(errmsg, sizeof(errmsg),
     1741                      _("Bad response (%d), expected %d"), rcode, code);
     1742
    17411743          sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET,
    17421744                          errmsg, _("sh_mail_wait"),
     
    18831885  int  ret, length, status;
    18841886  mx * result;
     1887  size_t len;
    18851888
    18861889  typedef union
     
    20652068       */
    20662069      result[count].pref = pref;
    2067       result[count].address = SH_ALLOC (strlen (expanded) + 1);
    2068       strcpy (result[count].address, expanded);        /* known to fit  */
     2070      len = strlen (expanded) + 1;
     2071      result[count].address = SH_ALLOC (len);
     2072      sl_strlcpy (result[count].address, expanded, len);
    20692073    }
    20702074  while (ret > 0 && comp_dn < eom && count);
     
    21012105  mx     * result;
    21022106  dnsrep * retval;
    2103   char     errmsg[128];
     2107  char     errmsg[128];
     2108  size_t   len;
    21042109
    21052110  SL_ENTER(_("return_mx"));
     
    21282133                           _("get_mx"));
    21292134#else
     2135          /* flawfinder: ignore *//* test code only */
    21302136          strcpy  (errmsg,                               /* known to fit  */
    21312137                   _("No MX record for domain "));
     
    21552161      result->pref  = 0;
    21562162      /*@-type@*/
    2157       result->address = SH_ALLOC (strlen (host->h_name) + 1);
    2158       strcpy (result->address, host->h_name);          /* known to fit  */
     2163      len = strlen (host->h_name) + 1;
     2164      result->address = SH_ALLOC (len);
     2165      sl_strlcpy (result->address, host->h_name, len);
    21592166      /*@+type@*/
    21602167      SL_RETURN (retval, _("return_mx"));
Note: See TracChangeset for help on using the changeset viewer.