File xcoral-arraysubscript.patch of Package xcoral
--- Smac/Makefile.in
+++ Smac/Makefile.in
@@ -37,7 +37,7 @@
all : $(OBJS)
word.h : word.c
- $(CC) -o word word.c
+ $(CC) $(CFLAGS) -o word word.c
rm -f word.h
./word > word.h
rm -f word
--- Smac/declaration.c
+++ Smac/declaration.c
@@ -242,7 +242,7 @@
HashTable__Add(DynamicVarsHashTable, (Object) varname, (Object) var);
- VarLocList = AddLast(VarLocList, List__List(0, var));
+ AddLast(VarLocList, List__List(0, var));
if (Type__IsaArray(type)) {
/* vecteur local, memorise en pile l'adresse en pile pour
--- color_area.c
+++ color_area.c
@@ -80,6 +80,7 @@
static PrivateCmap pcmap[32];
+void
InitPcmap ()
{
int i=0;
--- fs_box.c
+++ fs_box.c
@@ -301,7 +301,7 @@
if ( msg != 0 ) {
if ( strlen ( msg ) > (TITLE_SIZE - 2) ) {
(void) strncpy ( fs_box.title_text, msg, TITLE_SIZE -1 );
- fs_box.title_text [TITLE_SIZE] = '\0';
+ fs_box.title_text [TITLE_SIZE-1] = '\0';
}
else
(void) strcpy ( fs_box.title_text, msg );
--- handle_menus.c
+++ handle_menus.c
@@ -38,6 +38,7 @@
######################################################################## */
#include <stdio.h>
+#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
--- init_menus.c
+++ init_menus.c
@@ -39,6 +39,7 @@
#include <stdio.h>
+#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
--- list_box.c
+++ list_box.c
@@ -530,7 +530,7 @@
if ( msg != 0 ) {
if ( strlen ( msg ) > (TITLE_SIZE - 2) ) {
(void) strncpy ( l_box.title_text, msg, TITLE_SIZE -1 );
- l_box.title_text [TITLE_SIZE] = '\0';
+ l_box.title_text [TITLE_SIZE-1] = '\0';
}
else
(void) strcpy ( l_box.title_text, msg );
--- macros.c
+++ macros.c
@@ -39,6 +39,7 @@
#include <stdio.h>
+#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
--- main_events.c
+++ main_events.c
@@ -38,6 +38,7 @@
######################################################################## */
#include <stdio.h>
+#include <string.h>
#include <setjmp.h>
#include <signal.h>
#include <sys/types.h>
--- page.c
+++ page.c
@@ -45,6 +45,7 @@
#include <sys/types.h>
#include <sys/time.h>
#include <stdlib.h>
+#include <string.h>
#include "main_text.h"
#include "page.h"
--- process.c
+++ process.c
@@ -39,6 +39,7 @@
#include <stdio.h>
+#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <sys/types.h>
@@ -160,7 +161,7 @@
strcpy(shell,"/bin/csh");
}
}
- (void) execlp (shell, shell, "-i", 0);
+ (void) execlp (shell, shell, "-i", NULL);
(void) fprintf ( stderr, "Can't exec shell\n" );
break;
case -1:
--- xcoral.c
+++ xcoral.c
@@ -92,6 +92,7 @@
** Creer la premiere fenetre de texte et entre dans
** la boucle d'evenements.
*/
+int
main ( argc, argv )
int argc;
char **argv;
@@ -300,8 +301,8 @@
no_window = False;
WaitForEvent ();
-
/*NOTREACHED*/
+ return 0;
}
/*