Mercurial > hg > octave-avbm
changeset 10281:30078b201a2c
replace eval by sscanf in menu.m
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 09 Feb 2010 07:41:22 +0100 |
parents | b122dd3075ce |
children | c9780d8e228c |
files | scripts/ChangeLog scripts/miscellaneous/menu.m |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2010-02-09 Jaroslav Hajek <highegg@gmail.com> + + * miscellaneous/menu.m: Use sscanf rather than eval. + 2010-02-09 Jaroslav Hajek <highegg@gmail.com> * miscellaneous/substruct.m: Vectorize.
--- a/scripts/miscellaneous/menu.m +++ b/scripts/miscellaneous/menu.m @@ -63,7 +63,7 @@ endfor printf ("\n"); s = input ("pick a number, any number: ", "s"); - eval (sprintf ("num = %s;", s), "num = [];"); + num = sscanf (s, "%d"); if (! isscalar (num) || num < 1 || num > nopt) printf ("\nerror: input invalid or out of range\n\n"); else