summaryrefslogtreecommitdiff
path: root/src/head.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-10-17 14:01:00 +0000
committerJim Meyering <jim@meyering.net>1995-10-17 14:01:00 +0000
commitb792f7aa0e6b3c4d3beeb2952e427641207ebc5b (patch)
tree42003fa248780825bc56e34821c3bb126f27323e /src/head.c
parent9242af95a3b2f0e2cb3c76344a90c01a3e5750fd (diff)
downloadcoreutils-b792f7aa0e6b3c4d3beeb2952e427641207ebc5b.tar.xz
Add `const' attribute to dcls of lots of formals.
Diffstat (limited to 'src/head.c')
-rw-r--r--src/head.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/head.c b/src/head.c
index 117b28820..da4fb7251 100644
--- a/src/head.c
+++ b/src/head.c
@@ -114,7 +114,7 @@ multipliers bkm follows concatenated, else read -n VALUE.\n\
Return -1 if STR does not represent a valid unsigned integer. */
static long
-atou (char *str)
+atou (const char *str)
{
int value;
@@ -149,7 +149,7 @@ parse_unit (char *str)
}
static void
-write_header (char *filename)
+write_header (const char *filename)
{
static int first_file = 1;
@@ -158,7 +158,7 @@ write_header (char *filename)
}
static int
-head_bytes (char *filename, int fd, long int bytes_to_write)
+head_bytes (const char *filename, int fd, long int bytes_to_write)
{
char buffer[BUFSIZE];
int bytes_read;
@@ -183,7 +183,7 @@ head_bytes (char *filename, int fd, long int bytes_to_write)
}
static int
-head_lines (char *filename, int fd, long int lines_to_write)
+head_lines (const char *filename, int fd, long int lines_to_write)
{
char buffer[BUFSIZE];
int bytes_read;
@@ -210,7 +210,7 @@ head_lines (char *filename, int fd, long int lines_to_write)
}
static int
-head (char *filename, int fd, long int number)
+head (const char *filename, int fd, long int number)
{
if (unit_size)
return head_bytes (filename, fd, number);
@@ -219,7 +219,7 @@ head (char *filename, int fd, long int number)
}
static int
-head_file (char *filename, long int number)
+head_file (const char *filename, long int number)
{
int fd;
@@ -328,6 +328,7 @@ main (int argc, char **argv)
case 'n':
unit_size = 0;
getnum:
+ /* FIXME: use xstrtoul instead. */
number = atou (optarg);
if (number == -1)
error (1, 0, _("invalid number `%s'"), optarg);