source: trunk/dports/mail/ssmtp/files/02-557725-solaris.patch @ 78913

Last change on this file since 78913 was 78913, checked in by jmr@…, 8 years ago

ssmtp: update to 2.64

File size: 736 bytes
  • ssmtp.c

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557725
    
    Patch by Darik Horn <dajhorn@vanadac.com>
    
    old new static char hextab[]="0123456789abcdef"; 
    9898
    9999ssize_t outbytes;
    100100
     101#if defined(__APPLE__) || (defined (__SVR4) && defined (__sun))
     102/*
     103strndup() - Unimplemented by the Solaris libc.
     104*/
     105char * strndup(char const *s, size_t n)
     106{
     107        char *new;
     108        size_t len;
     109        if (s[n-1] != '\0') {
     110                len = n;
     111        } else {
     112                len = strlen(s);
     113        }
     114        new = malloc(len + 1);
     115        if(new == NULL) return NULL;
     116        new[len] = '\0';
     117        return memcpy(new, s, len);
     118}
     119#endif
     120
    101121/*
    102122log_event() -- Write event to syslog (or log file if defined)
    103123*/
Note: See TracBrowser for help on using the repository browser.