diff options
author | gad <gad@FreeBSD.org> | 2001-06-15 22:03:07 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2001-06-15 22:03:07 +0000 |
commit | e402d6c9159ae45f5056765c53cebfe6c25ee35e (patch) | |
tree | 34bd9934cba11944407fb52a6d7f9c516d667752 /usr.sbin/lpr/common_source/common.c | |
parent | 134649df9dfcfa24c39e28dcbf0b24db1b8f9605 (diff) | |
download | FreeBSD-src-e402d6c9159ae45f5056765c53cebfe6c25ee35e.zip FreeBSD-src-e402d6c9159ae45f5056765c53cebfe6c25ee35e.tar.gz |
Rename a few global variables which hold hostname-related values to be
more sensible/understandable. 'from'->'from_host' 'host'->'local_host'
'fromb'->'frombuf' 'fromhost'->'origin_host' and a local-variable
named 'host'->'hostbuf'. This fixes some compile-time warnings about
local variables shadowing global variables.
Other than renaming variables, the only actual code changes are to call
strlcpy() instead of strncpy() when setting those (renamed) variables,
and that 'from_ip' is now a strdup()-created buffer instead of being a
static buffer compiled in as 1025 bytes.
Reviewed by: freebsd-print@bostonradio.org (an earlier version)
MFC after: 1 week
Diffstat (limited to 'usr.sbin/lpr/common_source/common.c')
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 8e705db..8c434b0 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -553,8 +553,9 @@ fatal(pp, msg, va_alist) #else va_start(ap); #endif - if (from != host) - (void)printf("%s: ", host); + /* this error message is being sent to the 'from_host' */ + if (from_host != local_host) + (void)printf("%s: ", local_host); (void)printf("%s: ", progname); if (pp && pp->printer) (void)printf("%s: ", pp->printer); |