summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-07-04 10:14:03 +0000
committerJim Meyering <jim@meyering.net>1999-07-04 10:14:03 +0000
commitcdcf38b40f6787ad6c44530777ff7e0300d0f709 (patch)
tree0ae8cce6a941d381e9710ab2b2f0f26555564d11
parent3423927cfa06d288f500e166a2f70efa32a3a69e (diff)
downloadcoreutils-cdcf38b40f6787ad6c44530777ff7e0300d0f709.tar.xz
(find_field, different): Use size_t, not int, for lengths.
(writeline): Lines now contain trailing newline. (check_file): Use size_t, not int, for lengths.
-rw-r--r--src/uniq.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/uniq.c b/src/uniq.c
index 822a5389d..c50337b09 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -134,8 +134,8 @@ find_field (const struct linebuffer *line)
{
register int count;
register char *lp = line->buffer;
- register int size = line->length;
- register int i = 0;
+ register size_t size = line->length;
+ register size_t i = 0;
for (count = 0; count < skip_fields && i < size; count++)
{
@@ -157,7 +157,7 @@ find_field (const struct linebuffer *line)
OLDLEN and NEWLEN are their lengths. */
static int
-different (const char *old, const char *new, int oldlen, int newlen)
+different (const char *old, const char *new, size_t oldlen, size_t newlen)
{
register int order;
@@ -199,7 +199,6 @@ writeline (const struct linebuffer *line, FILE *stream, int linecount)
fprintf (stream, "%7d\t", linecount + 1);
fwrite (line->buffer, sizeof (char), line->length, stream);
- putc ('\n', stream);
}
/* Process input file INFILE with output to OUTFILE.
@@ -213,7 +212,7 @@ check_file (const char *infile, const char *outfile)
struct linebuffer lb1, lb2;
struct linebuffer *thisline, *prevline, *exch;
char *prevfield, *thisfield;
- int prevlen, thislen;
+ size_t prevlen, thislen;
int match_count = 0;
if (STREQ (infile, "-"))