diff options
author | Mark Murray <markm@FreeBSD.org> | 2002-02-22 21:11:03 +0000 |
---|---|---|
committer | Mark Murray <markm@FreeBSD.org> | 2002-02-22 21:11:03 +0000 |
commit | 4b4ed2fe6ab53c01ba519b8ae401cda7e2358884 (patch) | |
tree | e65b01fd1720f56839eb9669f22e5f916c60255e /bin/hostname/hostname.c | |
parent | fab912df88a4abeb6b7d0ee5a83b299d5d2ceb1d (diff) | |
download | src-4b4ed2fe6ab53c01ba519b8ae401cda7e2358884.tar.gz src-4b4ed2fe6ab53c01ba519b8ae401cda7e2358884.zip |
Fix warnings inspired by lint, a commercial lint and WARNS=4.
Notes
Notes:
svn path=/head/; revision=91084
Diffstat (limited to 'bin/hostname/hostname.c')
-rw-r--r-- | bin/hostname/hostname.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/hostname/hostname.c b/bin/hostname/hostname.c index 23171d60ffae..7700bdde8a52 100644 --- a/bin/hostname/hostname.c +++ b/bin/hostname/hostname.c @@ -83,8 +83,11 @@ main(int argc, char *argv[]) } else { if (gethostname(hostname, (int)sizeof(hostname))) err(1, "gethostname"); - if (sflag && (p = strchr(hostname, '.'))) - *p = '\0'; + if (sflag) { + p = strchr(hostname, '.'); + if (p != NULL) + *p = '\0'; + } (void)printf("%s\n", hostname); } exit(0); |