[BusyBox 0005594]: atan2, builtin function of awk, causes Segmentation Fault.

bugs at busybox.net bugs at busybox.net
Tue Oct 21 12:59:50 UTC 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=5594 
====================================================================== 
Reported By:                kotak
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   5594
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             10-20-2008 04:32 PDT
Last Modified:              10-21-2008 05:59 PDT
====================================================================== 
Summary:                    atan2, builtin function of awk, causes Segmentation
Fault.
Description: 
The following command causes "Segmentation Fault" though should return
"0.785398". 

awk 'BEGIN {print atan2(1,1);}'

The following patch fixes this.

Index: editors/awk.c
===================================================================
--- editors/awk.c       (revision 23739)
+++ editors/awk.c       (working copy)
@@ -2025,7 +2025,7 @@

        case B_a2:
 #if ENABLE_FEATURE_AWK_MATH
-               setvar_i(res, atan2(getvar_i(av[i]), getvar_i(av[1])));
+               setvar_i(res, atan2(getvar_i(av[0]), getvar_i(av[1])));
 #else
                syntax_error(EMSG_NO_MATH);
 #endif


Regards,
kotak
====================================================================== 

---------------------------------------------------------------------- 
 vda - 10-21-08 05:59  
---------------------------------------------------------------------- 
Fixed in rev 23755, thanks! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-20-08 04:32  kotak          New Issue                                    
10-20-08 04:32  kotak          Status                   new => assigned     
10-20-08 04:32  kotak          Assigned To               => BusyBox         
10-20-08 04:34  kotak          Issue Monitored: kotak                       
10-21-08 05:59  vda            Status                   assigned => closed  
10-21-08 05:59  vda            Note Added: 0013924                          
======================================================================




More information about the busybox-cvs mailing list