Changeset 22 for trunk/src/sh_schedule.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_schedule.c

    r1 r22  
    5353#endif
    5454
     55#include "samhain.h"
    5556#include "sh_mem.h"
    5657
     
    318319  char * copy;
    319320  int    i = 0;
     321  size_t len;
    320322
    321323  if (!ssched || !isched)
    322324    return -1;
    323325
     326  len = strlen(ssched)+1;
    324327#ifdef TESTONLY
    325   copy = malloc(strlen(ssched)+1);                 /* testonly code */
    326 #else
    327   copy = SH_ALLOC(strlen(ssched)+1);
    328 #endif
    329   strcpy(copy, ssched);                            /* known to fit  */
     328  copy = malloc(len);                 /* testonly code */
     329#else
     330  copy = SH_ALLOC(len);
     331#endif
     332  sl_strlcpy(copy, ssched, len);
    330333
    331334  p = strtok(copy, " \t"); /* parse crontab-style schedule */
Note: See TracChangeset for help on using the changeset viewer.