summaryrefslogtreecommitdiff
path: root/src/join.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-11-04 06:07:01 +0000
committerJim Meyering <jim@meyering.net>2003-11-04 06:07:01 +0000
commitd63bdf9a4d66e18abec04d6455efabb3c54e44a2 (patch)
tree23ccd6c87ed0a8e553ec122bc763c6b2e2452f37 /src/join.c
parent62e944695cf934066342f2da544eb70f630373f7 (diff)
downloadcoreutils-d63bdf9a4d66e18abec04d6455efabb3c54e44a2.tar.xz
(initseq, add_field, make_blank): Use `sizeof *var' rather
than `sizeof EXPLICIT_TYPE'. The former is more maintainable and usually shorter.
Diffstat (limited to 'src/join.c')
-rw-r--r--src/join.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/join.c b/src/join.c
index 16097837e..5b6ed31e7 100644
--- a/src/join.c
+++ b/src/join.c
@@ -288,7 +288,7 @@ initseq (struct seq *seq)
{
seq->count = 0;
seq->alloc = 1;
- seq->lines = xmalloc (seq->alloc * sizeof (struct line));
+ seq->lines = xmalloc (seq->alloc * sizeof *seq->lines);
}
/* Read a line from FP and add it to SEQ. Return 0 if EOF, 1 otherwise. */
@@ -609,7 +609,7 @@ add_field (int file, int field)
assert (file == 0 || file == 1 || file == 2);
assert (file == 0 ? field < 0 : field >= 0);
- o = xmalloc (sizeof (struct outlist));
+ o = xmalloc (sizeof *o);
o->file = file;
o->field = field;
o->next = NULL;
@@ -720,8 +720,7 @@ make_blank (struct line *blank, int count)
blank->buf.size = blank->buf.length = count + 1;
blank->buf.buffer = xmalloc (blank->buf.size);
buffer = (unsigned char *) blank->buf.buffer;
- blank->fields = fields =
- xmalloc (sizeof (struct field) * count);
+ blank->fields = fields = xmalloc (count * sizeof *fields);
for (i = 0; i < count; i++)
{
buffer[i] = '\t';