1
0
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:
Renaud 2015-03-17 09:04:22 +08:00
parent f97746a87b
commit d01649bf3a

6
eval.c
View File

@ -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)) ;