mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 07:16: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)) ;
|
||||
break ;
|
||||
case UFDIV:
|
||||
retstr = i_to_a( atoi( arg1) / atoi( argx)) ;
|
||||
sz = atoi( argx) ;
|
||||
retstr = (sz == 0) ? errorm : i_to_a( atoi( arg1) / sz) ;
|
||||
break ;
|
||||
case UFMOD:
|
||||
retstr = i_to_a( atoi( arg1) % atoi( argx)) ;
|
||||
sz = atoi( argx) ;
|
||||
retstr = (sz == 0) ? errorm : i_to_a( atoi( arg1) % sz) ;
|
||||
break ;
|
||||
case UFNEG:
|
||||
retstr = i_to_a( -atoi( argx)) ;
|
||||
|
Loading…
Reference in New Issue
Block a user