NVAL a, b;
/* return if a list is empty */
- if (!args[0] || !args[1])
+ if (!args[0] || !args[1]) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
p2 = trim_space_sep(args[1], sep);
/* return if a list is empty */
- if (!*p1 || !*p2)
+ if (!*p1 || !*p2) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
/* max the vectors */
start = *bp;
NVAL a, b;
/* return if a list is empty */
- if (!args[0] || !args[1])
+ if (!args[0] || !args[1]) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
char sep;
/* return if a list is empty */
- if (!args[0] || !args[1])
+ if (!args[0] || !args[1]) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
p2 = trim_space_sep(args[1], sep);
/* return if a list is empty */
- if (!*p1 || !*p2)
+ if (!*p1 || !*p2) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
/* add the vectors */
start = *bp;
char sep;
/* return if a list is empty */
- if (!args[0] || !args[1])
+ if (!args[0] || !args[1]) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
p2 = trim_space_sep(args[1], sep);
/* return if a list is empty */
- if (!*p1 || !*p2)
+ if (!*p1 || !*p2) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
/* subtract the vectors */
start = *bp;
char sep;
/* return if a list is empty */
- if (!args[0] || !args[1])
+ if (!args[0] || !args[1]) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
p2 = trim_space_sep(args[1], sep);
/* return if a list is empty */
- if (!*p1 || !*p2)
+ if (!*p1 || !*p2) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
/* multiply the vectors */
start = *bp;
char sep;
/* return if a list is empty */
- if (!args[0] || !args[1])
+ if (!args[0] || !args[1]) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
p2 = trim_space_sep(args[1], sep);
/* return if a list is empty */
- if (!*p1 || !*p2)
+ if (!*p1 || !*p2) {
+ safe_str(T("#-1 VECTORS MUST BE SAME DIMENSIONS"), buff, bp);
return;
+ }
/* multiply the vectors */
product = 0;
char sep;
/* return if a list is empty */
- if (!args[0])
+ if (!args[0]) {
+ safe_str(T("#-1 VECTOR MUST NOT BE EMPTY"), buff, bp);
return;
+ }
if (!delim_check(buff, bp, nargs, args, 2, &sep))
return;
p1 = trim_space_sep(args[0], sep);
/* return if a list is empty */
- if (!*p1)
+ if (!*p1) {
+ safe_str(T("#-1 VECTOR MUST NOT BE EMPTY"), buff, bp);
return;
+ }
/* sum the squares */
num = parse_number(split_token(&p1, sep));
char sep;
/* return if a list is empty */
- if (!args[0])
+ if (!args[0]) {
+ safe_str(T("#-1 VECTOR MUST NOT BE EMPTY"), buff, bp);
return;
+ }
if (!delim_check(buff, bp, nargs, args, 2, &sep))
return;
p1 = trim_space_sep(args[0], sep);
/* return if a list is empty */
- if (!*p1)
+ if (!*p1) {
+ safe_str(T("#-1 VECTOR MUST NOT BE EMPTY"), buff, bp);
return;
+ }
/* copy the vector, since we have to walk it twice... */
strcpy(tbuf, p1);
MATH *op;
/* Allocate memory */
- ptr = (char **) mush_malloc(BUFFER_LEN, "string");
+ ptr = (char **) mush_malloc(sizeof(char *) * BUFFER_LEN, "string");
if (!delim_check(buff, bp, nargs, args, 3, &sep)) {
mush_free((Malloc_t) ptr, "string");