mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-23 17:46:23 -05:00
Return error if &div or &mod by 0.
This commit is contained in:
parent
f97746a87b
commit
d01649bf3a
6
eval.c
6
eval.c
@ -401,10 +401,12 @@ static char *gtfun( char *fname) {
|
|||||||
retstr = i_to_a( atoi( arg1) * atoi( argx)) ;
|
retstr = i_to_a( atoi( arg1) * atoi( argx)) ;
|
||||||
break ;
|
break ;
|
||||||
case UFDIV:
|
case UFDIV:
|
||||||
retstr = i_to_a( atoi( arg1) / atoi( argx)) ;
|
sz = atoi( argx) ;
|
||||||
|
retstr = (sz == 0) ? errorm : i_to_a( atoi( arg1) / sz) ;
|
||||||
break ;
|
break ;
|
||||||
case UFMOD:
|
case UFMOD:
|
||||||
retstr = i_to_a( atoi( arg1) % atoi( argx)) ;
|
sz = atoi( argx) ;
|
||||||
|
retstr = (sz == 0) ? errorm : i_to_a( atoi( arg1) % sz) ;
|
||||||
break ;
|
break ;
|
||||||
case UFNEG:
|
case UFNEG:
|
||||||
retstr = i_to_a( -atoi( argx)) ;
|
retstr = i_to_a( -atoi( argx)) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user