PATCH: string funtions/speed up

From: Dominik Vogt (dominik.vogt@gmx.de)
Date: Thu Dec 18 2003 - 12:20:56 CET


I noticed some redundant calculations of string sizes in syslog.c
and syslogd.c in sysklogd-1.4.1 (patch attached, please proof
read).

Is there a specific reason why the sprintf return code is not used
here (syslog.c, vsyslog())?

        (void)sprintf(p, "[%d]", getpid());
        for (; *p; ++p);

The patch replaces that with

  n = sprintf(...);
  if (n < 0)
    p += n;

The "if (n < 0)" check may be unnecessary.

P.S.: Please CC me on replies.

Ciao

Dominik ^_^ ^_^



This archive was generated by hypermail 2.1.7 : Thu Dec 18 2003 - 13:17:01 CET