Skip to content

Commit

Permalink
Recover some speed lost in 0.54 by replacing strcpy with memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
athomason committed Apr 11, 2011
1 parent 0246d6e commit 46b396d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LogSyslogFast.c
Expand Up @@ -317,7 +317,7 @@ LSF_send(LogSyslogFast* logger, const char* msg_str, int msg_len, time_t t)
}

/* paste the message into linebuf just past where the prefix was placed */
strcpy(logger->msg_start, msg_str);
memcpy(logger->msg_start, msg_str, msg_len + 1); /* include perl-added null */

int ret = send(logger->sock, logger->linebuf, line_len, 0);

Expand Down

0 comments on commit 46b396d

Please sign in to comment.