summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/hostname/hostname.c7
-rw-r--r--bin/ln/ln.c1
-rw-r--r--bin/mkdir/mkdir.c8
3 files changed, 10 insertions, 6 deletions
diff --git a/bin/hostname/hostname.c b/bin/hostname/hostname.c
index 23171d6..7700bdd 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);
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index c3ce1d0..8cd33dc 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -131,6 +131,7 @@ main(int argc, char *argv[])
exit(linkit(argv[0], ".", 1));
case 2: /* ln target source */
exit(linkit(argv[0], argv[1], 0));
+ default:
}
/* ln target1 target2 directory */
sourcedir = argv[argc - 1];
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c
index bc06ff9..17e7ccf 100644
--- a/bin/mkdir/mkdir.c
+++ b/bin/mkdir/mkdir.c
@@ -57,16 +57,16 @@ static const char rcsid[] =
#include <sysexits.h>
#include <unistd.h>
-int build(char *, mode_t);
-void usage(void);
+static int build(char *, mode_t);
+static void usage(void);
int vflag;
int
main(int argc, char *argv[])
{
- int ch, exitval, success, omode, pflag;
- mode_t *set = (mode_t *)NULL;
+ int ch, exitval, success, pflag;
+ mode_t omode, *set = (mode_t *)NULL;
char *mode;
omode = pflag = 0;
OpenPOWER on IntegriCloud