cleanup, `getlims()' has to be used with number arg >= 1

This commit is contained in:
rlar 2011-07-17 16:44:07 +00:00
parent 3d2272c699
commit b998b92720
2 changed files with 20 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2011-07-17 Robert Larice
* src/frontend/plotting/plotit.c :
cleanup, `getlims()' has to be used with number arg >= 1
and get rid of an ancient hack
2011-07-17 Robert Larice
* src/frontend/arg.c ,
* src/frontend/com_hardcopy.c :

View File

@ -35,6 +35,9 @@ getlims(wordlist *wl, char *name, int number)
char *ss;
int n;
if(number < 1)
return NULL;
for (beg = wl; beg; beg = beg->wl_next) {
if (eq(beg->wl_word, name)) {
if (beg == wl) {
@ -44,7 +47,6 @@ getlims(wordlist *wl, char *name, int number)
return (NULL);
}
wk = beg;
if (number) {
d = TMALLOC(double, number);
for (n = 0; n < number; n++) {
wk = wk->wl_next;
@ -60,9 +62,6 @@ getlims(wordlist *wl, char *name, int number)
goto bad;
d[n] = *td;
}
} else
/* Minor hack... */
d = (double *) 1;
if (beg->wl_prev)
beg->wl_prev->wl_next = wk->wl_next;