diff options
author | John Kohl <jtkohl@mit.edu> | 1988-06-25 13:15:48 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1988-06-25 13:15:48 +0000 |
commit | 83e599faab7a8df2d1b8f14e305e1792c20205fd (patch) | |
tree | d993c54c683cc0b7ef9c5012fda80cd1d9be3f71 /zhm/zhm.c | |
parent | fc58c0925a6165a7d25c3d5834a54d91090f7d0e (diff) |
only format version once
Diffstat (limited to 'zhm/zhm.c')
-rw-r--r-- | zhm/zhm.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -409,6 +409,8 @@ int set_sig_type(sig) return(0); } +static char version[BUFSIZ] = ""; + send_stats(notice, sin) ZNotice_t *notice; struct sockaddr_in *sin; @@ -418,7 +420,6 @@ send_stats(notice, sin) char *bfr; char *list[20]; int len, i, nitems = 10; - char version[BUFSIZ]; newnotice = *notice; @@ -455,8 +456,9 @@ send_stats(notice, sin) /* Since ZFormatRaw* won't change the version number on notices, we need to set the version number explicitly. This code is taken from Zinternal.c, function Z_FormatHeader */ - (void) sprintf(version, "%s%d.%d", ZVERSIONHDR, ZVERSIONMAJOR, - ZVERSIONMINOR); + if (!*version) + (void) sprintf(version, "%s%d.%d", ZVERSIONHDR, ZVERSIONMAJOR, + ZVERSIONMINOR); newnotice.z_version = version; if ((ret = ZFormatRawNoticeList(&newnotice, list, nitems, &bfr, |