Bug 91406 - KStars: Array subscript out of range (INDI)
Summary: KStars: Array subscript out of range (INDI)
Status: RESOLVED FIXED
Alias: None
Product: kstars
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kstars
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-15 20:07 UTC by Marcin Garski
Modified: 2004-10-20 06:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Garski 2004-10-15 20:07:24 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

In indi/celestrongps.cpp there is section:

// North/South movement is illegal
 if (lastMove[NORTH] && lastMove[SOUTH])	
 {

------

In:
 indi/celestrongps.h
 indi/lx200generic.h

you can find:

int lastMove[4];

------
But in:
indi/celestronprotocol.h

you can find what NORTH and SOUTH is:

#if REVERSE_NS > 0
#define	NORTH		0
#define	SOUTH		4
#else
#define	NORTH		4
#define	SOUTH		0
#endif

------
In if() comparsion you check fifth element (it doesn't exist) of four elements array.
In #define '4' should be probably replaced by '3'.
Comment 1 kstars 2004-10-20 06:15:40 UTC
CVS commit by harris: 

Fixing bug #91406.  Some #define values were wrong.  Thanks for the 
report.

BUG: 91406
CCMAIL: kstars-devel@kde.org
 


  M +3 -3      celestronprotocol.h   1.2


--- kdeedu/kstars/kstars/indi/celestronprotocol.h  #1.1:1.2
@@ -50,11 +50,11 @@
 #if REVERSE_NS > 0
 #define NORTH           0
-#define SOUTH           4
+#define SOUTH           3
 #else
-#define NORTH           4
+#define NORTH           3
 #define SOUTH           0
 #endif
 
-#define EAST            3
+#define EAST            2
 #define WEST            1