many minor fixes and modifications

This commit is contained in:
ceriel
1987-03-20 08:30:31 +00:00
parent 73818f1a53
commit 4e03fc78dd
9 changed files with 43 additions and 18 deletions

View File

@@ -29,6 +29,7 @@
char *symbol2str();
char *long2str();
char *strncpy();
struct expr *do_array(), *do_struct(), *IVAL();
extern char options[];
@@ -482,7 +483,7 @@ ch_array(tpp, ex)
if (tp->tp_size == (arith)-1) {
/* set the dimension */
tp = *tpp = construct_type(ARRAY, tp->tp_up, length);
ntopad = align(tp->tp_size, word_align) - tp->tp_size;
ntopad = align(tp->tp_size, word_size) - tp->tp_size;
}
else {
arith dim = tp->tp_size / tp->tp_up->tp_size;
@@ -498,12 +499,13 @@ ch_array(tpp, ex)
length = dim;
}
}
ntopad = align(dim, word_align) - length;
ntopad = align(dim, word_size) - length;
}
/* throw out the characters of the already prepared string */
s = Malloc((int) (length + ntopad));
s = Malloc((unsigned) (length + ntopad));
clear(s, (int) (length + ntopad));
strncpy(s, ex->SG_VALUE, (int) length);
free(ex->SG_VALUE);
str_cst(s, (int) (length + ntopad));
free(s);
}