diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-02 12:25:55 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-02 12:25:55 +0000 |
commit | e26e311225f854dc2d6e0211187a15d95437d567 (patch) | |
tree | 922a209469a9054c2975baa95dac0228b4e917cf /syslogd.c | |
parent | 3554fc152dcaad91ec2df9d2ed879db5559179be (diff) | |
download | rsyslog-e26e311225f854dc2d6e0211187a15d95437d567.tar.gz rsyslog-e26e311225f854dc2d6e0211187a15d95437d567.tar.xz rsyslog-e26e311225f854dc2d6e0211187a15d95437d567.zip |
Applied patch to make rsyslog compile under solaris. thanks to Bartosz
Kuźma for providing the patch.
Diffstat (limited to 'syslogd.c')
-rw-r--r-- | syslogd.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -63,7 +63,7 @@ * to the database). * * rsyslog - An Enhanced syslogd Replacement. - * Copyright 2003-2005 Rainer Gerhards and Adiscon GmbH. + * Copyright 2003-2007 Rainer Gerhards and Adiscon GmbH. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -7843,13 +7843,16 @@ static rsRetVal cfline(char *line, register struct filed *f) tmp = ++p; for( ; *p && isdigit(*p) ; ++p, ++i) /* SKIP AND COUNT */; - f->f_un.f_forw.port = strndup(tmp, i); + f->f_un.f_forw.port = malloc(i + 1); if(f->f_un.f_forw.port == NULL) { logerror("Could not get memory to store syslog forwarding port, " "using default port, results may not be what you intend\n"); /* we leave f_forw.port set to NULL, this is then handled by * getFwdSyslogPt(). */ + } else { + memcpy(f->f_un.f_forw.port, tmp, i); + *(f->f_un.f_forw.port + i) = '\0'; } } |