summaryrefslogtreecommitdiff
path: root/debian/patches/2022.10.28.patch
blob: 45ce4f4dd0581fc1acc5d86aefe25a9d0fbec28d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
commit 8df721df25864f89772c58a4486314855bf1a37e
Author: Igor Pashev <pashev.igor@gmail.com>
Date:   Fri Oct 28 04:00:00 2022 +0200

    Fix some compiler warnings & buffer overflows

diff --git a/src/clef/edible.c b/src/clef/edible.c
index 7a6c4826..c3022060 100644
--- a/src/clef/edible.c
+++ b/src/clef/edible.c
@@ -69,7 +69,6 @@ using namespace OpenAxiom;
 
 #define Cursor_shape(x) 
 
-static void check_flip(void);
 static void catch_signals(void);
 static void init_parent(void);
 static void set_function_chars(void);
diff --git a/src/etc/asq.c.pamphlet b/src/etc/asq.c.pamphlet
index 44771f36..0ef9c5ef 100644
--- a/src/etc/asq.c.pamphlet
+++ b/src/etc/asq.c.pamphlet
@@ -450,7 +450,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 /* asq is a mini browser for the AXIOM databases                            */
 
-#define VERSION 7
+#define ASQ_VERSION 7
 /* 040206007 tpd fix anal compiler warnings                                 */
 /* 030710006 tpd remove share directory                                     */
 /* 940112005 tpd cleanup of printinfo                                       */
@@ -1448,7 +1448,7 @@ int pprintcond(int seekpt,char *path);
  printf("searchkey can be either a domain or its abbreviation.\n");
  printf("\n e.g. %s -so Integer\n",arg);
  printf("   will give the source file name written to stdout\n");
- printf(" (Version %d)\n",VERSION);
+ printf(" (Version %d)\n", ASQ_VERSION);
  return(0);
 }
 
diff --git a/src/graph/include/view.h b/src/graph/include/view.h
index 5d77d46f..6df571a0 100644
--- a/src/graph/include/view.h
+++ b/src/graph/include/view.h
@@ -34,8 +34,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 /* This file is to be included by all the viewport files */
 
 #define check(code)	checker(code,__LINE__,"")
-#undef saymem
+#ifndef saymem
 #define saymem(a,b,c)	saymemWithLine(a,b,c,__LINE__)
+#endif
 #define exitWithAck(ACK,ACKsize,i) \
 		check(write(Socket,&(ACK),sizeof(ACKsize)));  exit(i);
 #define NIL(type)	((type *)NULL)
diff --git a/src/graph/view2D/header2.h b/src/graph/view2D/header2.h
index c7d63985..bbd11a10 100644
--- a/src/graph/view2D/header2.h
+++ b/src/graph/view2D/header2.h
@@ -228,7 +228,7 @@ typedef struct _buttonStruct {
 typedef struct _controlPanelStruct {
   int                  numOfButtons;
   Window               controlWindow,messageWindow,colormapWindow;
-  char                 message[40];
+  char                 message[80];
   struct _buttonStruct buttonQueue[maxButtons2D];
 } controlPanelStruct;
 
diff --git a/src/graph/view2D/process2d.c b/src/graph/view2D/process2d.c
index 276948ef..52c326f6 100644
--- a/src/graph/view2D/process2d.c
+++ b/src/graph/view2D/process2d.c
@@ -493,7 +493,7 @@ processEvents(void)
   Window                  whichWindow;
   XWindowAttributes       graphWindowAttrib;
   buttonStruct            *controlButton;
-  mouseCoord              mouseXY;
+  mouseCoord              mouseXY = {0.0, 0.0};
   int                     i,
     someInt,
     mouseW4,
@@ -561,7 +561,7 @@ processEvents(void)
         switch(((XEvent *)event)->type) {
           
         case ClientMessage:
-          if (event->xclient.data.l[0] == wm_delete_window) {
+          if ((Atom)event->xclient.data.l[0] == wm_delete_window) {
                   goodbye(-1);
           }
           else {
@@ -799,7 +799,7 @@ processEvents(void)
             for (i=0; i<maxGraphs; i++) {
               if (graphStateArray[i].showing && graphStateArray[i].selected) {
                 if (zoomXON) {
-                  graphStateArray[i].scaleX *= (1 - mouseXY.y * 0.3);
+                  graphStateArray[i].scaleX *= (1 - mouseXY.x * 0.3);
                   if (graphStateArray[i].scaleX > maxScale)
                     graphStateArray[i].scaleX = maxScale;
                   else if (graphStateArray[i].scaleX < minScale)
diff --git a/src/graph/view2D/write2d.c b/src/graph/view2D/write2d.c
index 4431da08..395b821a 100644
--- a/src/graph/view2D/write2d.c
+++ b/src/graph/view2D/write2d.c
@@ -47,33 +47,31 @@
 #include "Gfun.H1"
 
 
-#define numBits (8*sizeof(int))
+#define numBits ((int)(8*sizeof(int)))
 
 int 
 writeViewport(int thingsToWrite)
 {
 
   FILE              *viewDataFile;
-  char              viewDirName[80],
-                    viewBitmapFilename[80],viewDataFilename[80],command[80];
+  char              buf[1024];
   int               i,j,k,ii;
   pointListStruct   *aList;
   pointStruct       *aPoint;
   XWindowAttributes vwInfo;
 
   XGetWindowAttributes(dsply,viewport->titleWindow,&vwInfo);
-  sprintf(viewDirName,"%s%s",filename,".VIEW"); 
-  sprintf(command,"%s%s%s","rm -r ",viewDirName," >  /dev/null 2>&1");
-  system(command);
-  sprintf(command,"%s%s%s","mkdir ",viewDirName," > /dev/null 2>&1");
-  if (system(command)) {
-    fprintf(stderr,"   Error: Cannot create %s\n",viewDirName);
+  sprintf(buf, "rm -f %s.VIEW", filename);
+  system(buf);
+  sprintf(buf, "mkdir %s.VIEW", filename);
+  if (system(buf)) {
+    fprintf(stderr,"   Error: Cannot create %s.VIEW\n", filename);
     return(-1);
   } else {
             /*** Create the data file ***/
-    sprintf(viewDataFilename,"%s%s",viewDirName,"/data");
-    if ((viewDataFile = fopen(viewDataFilename,"w")) == NULL) {
-      fprintf(stderr,"   Error: Cannot create %s\n",viewDataFilename);
+    sprintf(buf,"%s.VIEW/data", filename);
+    if ((viewDataFile = fopen(buf,"w")) == NULL) {
+      fprintf(stderr,"   Error: Cannot create %s\n", buf);
       perror("fopen");
       return(-1);
     } else {
@@ -101,9 +99,9 @@ writeViewport(int thingsToWrite)
       fclose(viewDataFile);
       for (i=0; i<maxGraphs; i++) {
         if (graphArray[i].key) {
-          sprintf(viewDataFilename,"%s%s%d",viewDirName,"/graph",i);
-          if ((viewDataFile = fopen(viewDataFilename,"w")) == NULL) {
-            fprintf(stderr,"   Error: Cannot create %s\n",viewDataFilename);
+          sprintf(buf,"%s.VIEW/graph%d", filename, i);
+          if ((viewDataFile = fopen(buf,"w")) == NULL) {
+            fprintf(stderr,"   Error: Cannot create %s\n", buf);
             perror("fopen");
             return(-1);
           } else {
@@ -143,37 +141,37 @@ writeViewport(int thingsToWrite)
         switch (ii) {
         case Pixmap:
             /*** Create the pixmap (bitmaps need leaf name) ***/
-          sprintf(viewBitmapFilename,"%s%s",viewDirName,"/image.xpm");
+          sprintf(buf,"%s.VIEW/image.xpm", filename);
           XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
-          write_pixmap_file(dsply,scrn,viewBitmapFilename,
+          write_pixmap_file(dsply,scrn,buf,
                                    viewport->titleWindow,0,0,vwInfo.width,
                                    vwInfo.height+titleHeight);
           break;
         case Bitmap:
             /*** Create the bitmap (bitmaps need leaf name) ***/
-          sprintf(viewBitmapFilename,"%s%s",viewDirName,"/image.bm");
+          sprintf(buf,"%s.VIEW/image.bm", filename);
           XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
-          XWriteBitmapFile(dsply,viewBitmapFilename,
+          XWriteBitmapFile(dsply,buf,
                                   viewport->titleWindow,vwInfo.width,
                                   vwInfo.height+vwInfo.border_width+20,-1,-1);
           break;
         case Image:
             /*** Create the pixmap (bitmaps need leaf name) ***/
-          sprintf(viewBitmapFilename,"%s%s",viewDirName,"/image.xpm");
+          sprintf(buf,"%s.VIEW/image.xpm", filename);
           XResizeWindow(dsply,viewport->titleWindow,300,300+titleHeight);
           XResizeWindow(dsply,viewport->viewWindow,300,300);
           XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
           drawViewport(Xoption);
           writeTitle();
-          write_pixmap_file(dsply,scrn,viewBitmapFilename,
+          write_pixmap_file(dsply,scrn,buf,
                                    viewport->titleWindow,0,0,vwInfo.width,
                                    vwInfo.height+titleHeight);
             /*** Create the bitmap (bitmaps need leaf name) ***/
           mono = 1;
           drawViewport(Xoption);
           writeTitle();
-          sprintf(viewBitmapFilename,"%s%s%s",viewDirName,"/","image.bm");
-          XWriteBitmapFile(dsply,viewBitmapFilename,
+          sprintf(buf,"%s.VIEW/image.bm", filename);
+          XWriteBitmapFile(dsply,buf,
                                   viewport->titleWindow,vwInfo.width,
                                   vwInfo.height+vwInfo.border_width+20,-1,-1);
           mono = 0;
@@ -181,7 +179,7 @@ writeViewport(int thingsToWrite)
 
         case Postscript:
             /*** Create postscript output for viewport (in axiom2D.ps) ***/
-         sprintf(PSfilename,"%s%s",viewDirName,"/axiom2D.ps");
+         sprintf(PSfilename,"%s.VIEW/axiom2D.ps", filename);
          if (PSInit(viewport->viewWindow,viewport->titleWindow) == psError)
            return (-1);
          drawViewport(PSoption);  /* write new script file in /tmp */
diff --git a/src/graph/view3D/header.h b/src/graph/view3D/header.h
index 53dd24ab..e029f12b 100644
--- a/src/graph/view3D/header.h
+++ b/src/graph/view3D/header.h
@@ -134,19 +134,12 @@
                       /***         colors         ***/
                       /******************************/
 
-#define totalHuesConst  27
-
-#define hueEnd          360
-
-#undef hueStep
-#define hueStep         (hueEnd/totalHuesConst)
 
 #define black           BlackPixel(dsply,scrn)
 #define white           WhitePixel(dsply,scrn)
 #define numPlanes       1
 #define numColors       10
 #define startColor      0
-#define maxColors       (DisplayCells(dsply,scrn)-1)
 #define maxPlanes       (DefaultVisual((dpy),(scr))->bits_per_rgb)
 
                       /**********************************/
diff --git a/src/graph/view3D/lighting3d.c b/src/graph/view3D/lighting3d.c
index 666c708c..5d0b5489 100644
--- a/src/graph/view3D/lighting3d.c
+++ b/src/graph/view3D/lighting3d.c
@@ -79,6 +79,26 @@
 #define arrowHead (control->buttonQueue[lightTranslucent].buttonX + 5)
 static viewTriple point0 = {0,0,0};
 
+static float labels[basicScreen][7] = {
+  {105,0,4,106,0,3,labelColor},     /* script x label - 4 segments */
+  {106,0,3,112,0,10,labelColor},
+  {112,0,10,114,0,9,labelColor},
+  {106,0,10,113,0,3,labelColor},
+  {0,106,9,0,107,10,labelColor},    /* script y label - 7 segments */
+  {0,107,10,0,107,6,labelColor},
+  {0,107,6,0,113,5,labelColor},
+  {0,113,10,0,113,-3,labelColor},
+  {0,113,-3,0,111,-5,labelColor},
+  {0,111,-5,0,110,-1,labelColor},
+  {0,110,-1,0,114,3,labelColor},
+  {0,5,114,0,6,115,labelColor},     /* script z label - 8 segments */
+  {0,6,115,0,11,116,labelColor},
+  {0,11,116,0,12,113,labelColor},
+  {0,12,113,0,10,111,labelColor},
+  {0,10,111,0,11,110,labelColor},
+  {0,11,110,0,11,103,labelColor},
+  {0,11,103,0,9,102,labelColor},
+  {0,9,102,0,9,105,labelColor}};
 
 /***************************
  * int makeLightingPanel() *
diff --git a/src/graph/view3D/process3d.c b/src/graph/view3D/process3d.c
index 5c5e7d68..f5adbf9e 100644
--- a/src/graph/view3D/process3d.c
+++ b/src/graph/view3D/process3d.c
@@ -856,7 +856,7 @@ processEvents(void)
   XEvent                *event, tempEvent;
   Window                whichWindow;
   buttonStruct          *controlButton;
-  mouseCoord            mouseXY, linearMouseXY;
+  mouseCoord            mouseXY = {0.0, 0.0}, linearMouseXY = {0.0, 0.0};
   int                   someInt, mouseW4, mouseH4;
   int                   toggleReady =yes;
   int                   checkButton = no;
@@ -939,7 +939,7 @@ processEvents(void)
         
         switch(((XEvent *)event)->type) {
         case ClientMessage:
-          if (event->xclient.data.l[0] == wm_delete_window) {
+          if ((Atom)event->xclient.data.l[0] == wm_delete_window) {
             goodbye(-1);
           }
           else {
diff --git a/src/graph/view3D/smoothShade3d.c b/src/graph/view3D/smoothShade3d.c
index 5d09a4ed..b794f210 100644
--- a/src/graph/view3D/smoothShade3d.c
+++ b/src/graph/view3D/smoothShade3d.c
@@ -753,7 +753,7 @@ showAxesLabels(int dFlag)
   else GSetForeground(GC9991,psBlack,dFlag);
 
   /* axes label for X */
-  if ((int)axesZ[0][0] >= (int)axesZ[0][2]) {
+  if ((int)axesZ[0][0] >= (int)axesZ[0][1]) {
     if (axesXY[0][2] < axesXY[0][0]) xcoord2 = axesXY[0][2]-5;
     else xcoord2 = axesXY[0][2] + 5;
     if (axesXY[0][3] < axesXY[0][1]) ycoord2 = axesXY[0][3]-5;
diff --git a/src/graph/view3D/static.h b/src/graph/view3D/static.h
index 201f272b..8175c642 100644
--- a/src/graph/view3D/static.h
+++ b/src/graph/view3D/static.h
@@ -40,24 +40,4 @@ static float axes[3][6] = {{-117,0,0,117,0,0},     /* x axis */
 			   {0,-117,0,0,117,0},     /* y axis */
 			   {0,0,-117,0,0,117}};    /* z axis */
 
-/* text labels are currently used */
-static float labels[basicScreen][7] = {
-  {105,0,4,106,0,3,labelColor},     /* script x label - 4 segments */
-  {106,0,3,112,0,10,labelColor},
-  {112,0,10,114,0,9,labelColor},
-  {106,0,10,113,0,3,labelColor},
-  {0,106,9,0,107,10,labelColor},    /* script y label - 7 segments */
-  {0,107,10,0,107,6,labelColor},
-  {0,107,6,0,113,5,labelColor},
-  {0,113,10,0,113,-3,labelColor},
-  {0,113,-3,0,111,-5,labelColor},
-  {0,111,-5,0,110,-1,labelColor},
-  {0,110,-1,0,114,3,labelColor},
-  {0,5,114,0,6,115,labelColor},     /* script z label - 8 segments */
-  {0,6,115,0,11,116,labelColor},
-  {0,11,116,0,12,113,labelColor},
-  {0,12,113,0,10,111,labelColor},
-  {0,10,111,0,11,110,labelColor},
-  {0,11,110,0,11,103,labelColor},
-  {0,11,103,0,9,102,labelColor},
-  {0,9,102,0,9,105,labelColor}};  
+
diff --git a/src/graph/view3D/volume3d.c b/src/graph/view3D/volume3d.c
index 348a39d6..87bce529 100644
--- a/src/graph/view3D/volume3d.c
+++ b/src/graph/view3D/volume3d.c
@@ -698,7 +698,7 @@ void
 drawVolumePanel (void)
 {
 
-  int i,strlength;
+  size_t i,strlength;
 
 
             /* Draw some lines for volume panel. */
@@ -733,13 +733,16 @@ drawVolumePanel (void)
                  100,100,Xoption);
 
 
-  for (i=0; i<strlen(clipMess); i++)
+  strlength = strlen(clipMess);
+  for (i=0; i<strlength; i++)
     GDrawString(trashGC,volumeWindow,clipMessX,clipMessY + i*clipMessDy,
                 &(clipMess[i]),1,Xoption);
-  for (i=0; i<strlen(eyeMess1); i++)
+  strlength = strlen(eyeMess1);
+  for (i=0; i<strlength; i++)
     GDrawString(trashGC,volumeWindow,eyeMess1X,eyeMess1Y + i*eyeMess1Dy,
                 &(eyeMess1[i]),1,Xoption);
-  for (i=0; i<strlen(eyeMess2); i++)
+  strlength = strlen(eyeMess2);
+  for (i=0; i<strlength; i++)
     GDrawString(trashGC,volumeWindow,eyeMess2X,eyeMess2Y + i*eyeMess2Dy,
                 &(eyeMess2[i]),1,Xoption);
 
diff --git a/src/graph/view3D/write3d.c b/src/graph/view3D/write3d.c
index 724fe5cc..7eeaf15b 100644
--- a/src/graph/view3D/write3d.c
+++ b/src/graph/view3D/write3d.c
@@ -51,7 +51,7 @@
 #include "all_3d.H1"
 
   /* upper limit as to how many kinds of files could be written (numBits-1) */
-#define numBits (8*sizeof(int))
+#define numBits ((int)(8*sizeof(int)))
 #define StellarColors 9
 
 int 
@@ -64,25 +64,21 @@ writeViewport (int thingsToWrite)
   viewTriple        *aPt;
   XWindowAttributes vwInfo;
   FILE              *viewDataFile;
-  char              viewDirName[80], viewDataFilename[80],
-                    viewBitmapFilename[80], viewPixmapFilename[80],
-                    command[80];
+  char              buf[1024];
 
   XGetWindowAttributes(dsply,viewport->titleWindow,&vwInfo);
-  sprintf(viewDirName,"%s%s",filename,".VIEW"); 
-  sprintf(command,"%s%s%s","rm -r ",viewDirName," >  /dev/null 2>&1");
-  system(command);
-  sprintf(command,"%s%s%s","mkdir ",viewDirName," > /dev/null 2>&1");
-  system(command);
-  if (0) {
-    fprintf(stderr,"   Error: Cannot create %s\n",viewDirName);
+  sprintf(buf, "rm -f %s.VIEW", filename);
+  system(buf);
+  sprintf(buf, "mkdir %s.VIEW", filename);
+  if (system(buf)) {
+    fprintf(stderr,"   Error: Cannot create %s.VIEW\n", filename);
     return(-1);
   } else {
 
             /*** Create the data file ***/
-    sprintf(viewDataFilename,"%s%s",viewDirName,"/data");
-    if ((viewDataFile = fopen(viewDataFilename,"w")) == NULL) {
-      fprintf(stderr,"   Error: Cannot create %s\n",viewDataFilename);
+    sprintf(buf,"%s.VIEW/data", filename);
+    if ((viewDataFile = fopen(buf,"w")) == NULL) {
+      fprintf(stderr,"   Error: Cannot create %s\n", buf);
       perror("fopen");
       return(-1);
     } else {
@@ -140,18 +136,18 @@ writeViewport (int thingsToWrite)
         switch (ii) {
         case Bitmap:
             /*** Create the pixmap (bitmaps need leaf name) ***/
-          sprintf(viewBitmapFilename,"%s%s%s",viewDirName,"/","image.bm");
+          sprintf(buf,"%s.VIEW/image.bm", filename);
           XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
-          XWriteBitmapFile(dsply,viewBitmapFilename,
+          XWriteBitmapFile(dsply,buf,
                                   viewport->titleWindow,vwInfo.width,
                                   vwInfo.height+vwInfo.border_width+20,-1,-1);
           break;
 
         case Pixmap:
             /*** Create the pixmap (bitmaps need leaf name) ***/
-          sprintf(viewPixmapFilename,"%s%s%s",viewDirName,"/","image.xpm");
+          sprintf(buf,"%s.VIEW/image.xpm", filename);
           XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
-          write_pixmap_file(dsply,scrn,viewPixmapFilename,
+          write_pixmap_file(dsply,scrn,buf,
                                    viewport->titleWindow,0,0,vwInfo.width,
                                    vwInfo.height+titleHeight);
           break;
@@ -159,7 +155,7 @@ writeViewport (int thingsToWrite)
         case Image:
             /*** Create the image (bitmaps need leaf name) ***/
           writeImage = yes;
-          sprintf(viewPixmapFilename,"%s%s%s",viewDirName,"/","image.xpm");
+          sprintf(buf,"%s.VIEW/image.xpm", filename);
           XResizeWindow(dsply,viewport->titleWindow,300,300+titleHeight);
           XResizeWindow(dsply,viewport->viewWindow,300,300);
           viewport->hueTop = totalHues-1;  viewport->hueOffset = 0;
@@ -174,7 +170,7 @@ writeViewport (int thingsToWrite)
           drawViewport(Xoption);
           writeTitle();
           XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
-          write_pixmap_file(dsply,scrn,viewPixmapFilename,
+          write_pixmap_file(dsply,scrn,buf,
                                    viewport->titleWindow,0,0,vwInfo.width,
                                    vwInfo.height+titleHeight);
           viewport->monoOn = 1;
@@ -182,8 +178,8 @@ writeViewport (int thingsToWrite)
           firstTime = 1;
           drawViewport(Xoption);
           writeTitle();
-          sprintf(viewBitmapFilename,"%s%s%s",viewDirName,"/","image.bm");
-          XWriteBitmapFile(dsply,viewBitmapFilename,
+          sprintf(buf,"%s.VIEW/image.bm", filename);
+          XWriteBitmapFile(dsply,buf,
                                   viewport->titleWindow,vwInfo.width,
                                   vwInfo.height+vwInfo.border_width+20,-1,-1);
                                   
@@ -192,7 +188,7 @@ writeViewport (int thingsToWrite)
 
         case Postscript:
             /*** Create postscript output for viewport (in axiom3D.ps) ***/
-         sprintf(PSfilename,"%s%s",viewDirName,"/axiom3D.ps");
+         sprintf(PSfilename,"%s.VIEW/axiom3D.ps", filename);
          if (PSInit(viewport->viewWindow,viewport->titleWindow) == psError)
            return(-1);
          drawViewport(PSoption);  /* write new script file in /tmp */
diff --git a/src/graph/viewAlone/spoon2D.c b/src/graph/viewAlone/spoon2D.c
index 00f46e31..912d834b 100644
--- a/src/graph/viewAlone/spoon2D.c
+++ b/src/graph/viewAlone/spoon2D.c
@@ -58,7 +58,7 @@ spoonView2D(void)
 {
 
   int  i,code,pipe0[2],pipe1[2],there;
-  char envAXIOM[100],runView[100];
+  char runView[100];
 
   sprintf(errorStr,"%s","creating pipes");
   check(pipe(pipe0));
@@ -84,8 +84,7 @@ spoonView2D(void)
     close(pipe1[1]);
     printf("(spoon2D child) start the TwoDimensionalViewport process\n");
     sprintf(errorStr,"%s","(viewAlone) execution of the TwoDimensionalViewport process");
-    sprintf(envAXIOM,"%s",oa_getenv("AXIOM"));
-    sprintf(runView,"%s%s",envAXIOM,"/lib/view2D");
+    sprintf(runView,"%s/lib/view2D",oa_getenv("AXIOM"));
     check(execl(runView,runView, (char*)NULL));
     fprintf(stderr,"Could not execute view2D! Check that view2D is on your path variable.\n");
     exit(-1);
@@ -215,7 +214,7 @@ makeView2DFromFileData(view2DStruct *doView2D)
   int i,j,k;
   char title[256];
   FILE *graphFile;
-  char graphFilename[256];
+  char graphFilename[512];
   pointListStruct *aList;
   pointStruct     *aPoint;
   printf("(spoon2D makeView2DFromFileData)\n");  
@@ -280,7 +279,7 @@ makeView2DFromFileData(view2DStruct *doView2D)
   for (i=0; i<maxGraphs; i++) {
     if (graphArray[i].key) {
       /** OPEN FILE FOR GRAPHS **/
-      sprintf(graphFilename,"%s%s%d",pathname,"/graph",i);
+      sprintf(graphFilename,"%s/graph%d",pathname,i);
       if ((graphFile = fopen(graphFilename,"r")) == NULL) {
         fprintf(stderr,"   Error: Cannot find the file %s\n",graphFilename);
         perror("fopen");
diff --git a/src/graph/viewAlone/spoonComp.c b/src/graph/viewAlone/spoonComp.c
index 5714d04f..0b3be3ba 100644
--- a/src/graph/viewAlone/spoonComp.c
+++ b/src/graph/viewAlone/spoonComp.c
@@ -60,7 +60,7 @@ spoonView3D(int type)
 {
   
   int  i,j,k,code,pipe0[2],pipe1[2];
-  char envAXIOM[100],runView[100];
+  char runView[100];
   LLPoint *anLLPoint;
   LPoint *anLPoint;
   int *anIndex;
@@ -86,8 +86,7 @@ spoonView3D(int type)
     
     sprintf(errorStr,"%s",
             "(viewAlone) execution of the ThreeDimensionalViewport process");
-    sprintf(envAXIOM,"%s",oa_getenv("AXIOM"));
-    sprintf(runView,"%s%s",envAXIOM,"/lib/view3D");
+    sprintf(runView,"%s/lib/view3D",oa_getenv("AXIOM"));
     check(execl(runView,runView, (char*) NULL));
     fprintf(stderr,"Could not execute view3D!\n");
     exit(-1);
diff --git a/src/graph/viewman/fun2D.c b/src/graph/viewman/fun2D.c
index af7724d9..17fedab5 100644
--- a/src/graph/viewman/fun2D.c
+++ b/src/graph/viewman/fun2D.c
@@ -183,7 +183,7 @@ forkView2D(void)
   int              there;
   int  pipe0[2], pipe1[2];
 
-  char envAXIOM[100],runView[100];
+  char envAXIOM[100], runView[200];
 
 #ifdef DEBUG
   fprintf(stderr,"fun2D:Pipe calls for 2D\n");
diff --git a/src/graph/viewman/fun3D.c b/src/graph/viewman/fun3D.c
index 35f79cc4..93645a29 100644
--- a/src/graph/viewman/fun3D.c
+++ b/src/graph/viewman/fun3D.c
@@ -235,7 +235,7 @@ forkView3D(int typeOfViewport)
   int  pipe0[2],pipe1[2];
   int *anIndex;
 
-  char envAXIOM[100],runView[100];
+  char envAXIOM[100], runView[200];
   int j,k;
   LLPoint *anLLPoint;
   LPoint *anLPoint;
diff --git a/src/hyper/ReadBitmap.c b/src/hyper/ReadBitmap.c
index d1ada58c..ee8e89d2 100644
--- a/src/hyper/ReadBitmap.c
+++ b/src/hyper/ReadBitmap.c
@@ -58,7 +58,6 @@ HTReadBitmapFile(Display *display,int screen,char * filename,
     XImage *image;
     FILE *fd;
     char Line[256], Buff[256];
-    int num_chars;
     char *ptr;
     int rch;
     int version;
@@ -134,7 +133,6 @@ HTReadBitmapFile(Display *display,int screen,char * filename,
     (image)->bytes_per_line = chars_line = (*width + 7) / 8;
     file_chars_line = chars_line + padding;
 
-    num_chars = chars_line * (*height);
     file_chars = file_chars_line * (*height);
     (image)->data = (char *) halloc((image)->bytes_per_line * (image)->height,
                                     "Read Pixmap--Image data");
diff --git a/src/hyper/dialog.c b/src/hyper/dialog.c
index fe7b78aa..e3ae5122 100644
--- a/src/hyper/dialog.c
+++ b/src/hyper/dialog.c
@@ -87,6 +87,13 @@ static void overwrite_buffer(char * buffer , InputItem * item);
 static void redraw_win();
 static void tough_enter(InputItem * sym);
 
+static void
+strnmov(char *dest, const char *src, size_t n)
+{
+  while (n-- && (*dest++ = *src++));
+}
+
+
 static void
 redraw_win()
 {
@@ -248,7 +255,7 @@ move_sym_forward(LineStruct *line, int num, int size, InputItem *sym)
             return 1;
         }
         else {
-            strncpy(&line->buffer[num], line->buffer, line->len);
+            strnmov(&line->buffer[num], line->buffer, line->len);
             line->len += num;
             line->changed = 1;
             return 0;
@@ -310,7 +317,7 @@ insert_buffer(char *buffer, InputItem *sym)
         else {
             line->next->buffer[0] = line->buffer[size - 1];
             line->changed = 1;
-            strncpy(&line->buffer[line->buff_pntr + 1],
+            strnmov(&line->buffer[line->buff_pntr + 1],
                 &line->buffer[line->buff_pntr], size - line->buff_pntr - 1);
             line->buffer[line->buff_pntr++] = buffer[0];
             line->changed = 1;
@@ -346,7 +353,7 @@ insert_buffer(char *buffer, InputItem *sym)
             /* we are not the leaders */
             newline->buffer[0] = line->buffer[size - 1];
             newline->len = 1;
-            strncpy(&line->buffer[line->buff_pntr + 1],
+            strnmov(&line->buffer[line->buff_pntr + 1],
                     &line->buffer[line->buff_pntr], size - line->buff_pntr);
             if (line->buff_pntr < size - 1) {
                 line->buffer[line->buff_pntr++] = buffer[0];
@@ -672,7 +679,7 @@ move_rest_back(LineStruct *line, int size)
         return c;
 
     while (line->next != NULL && line->len > size) {
-        strncpy(line->buffer, &(line->buffer[1]), size - 1);
+        strnmov(line->buffer, &(line->buffer[1]), size - 1);
         line->buffer[size - 1] = line->next->buffer[0];
         line->changed = 1;
         line = line->next;
@@ -685,7 +692,7 @@ move_rest_back(LineStruct *line, int size)
     if (line->len > 0) {
         line->changed = 1;
         if (line->len > 1)
-            strncpy(line->buffer, &(line->buffer[1]), line->len - 1);
+            strnmov(line->buffer, &(line->buffer[1]), line->len - 1);
         line->buffer[--line->len] = 0;
         if (line->len == 0) {
             /* I have to fix the previous line */
@@ -867,7 +874,7 @@ move_back_one_char(InputItem *sym)
         else if (line->len > 0) {
             d = line->buffer[0];
             if (line->len <= sym->size) {
-                strncpy(line->buffer, &(line->buffer[1]), line->len - 1);
+                strnmov(line->buffer, &(line->buffer[1]), line->len - 1);
                 if (c == 0) {
                     line->len--;
                     line->buffer[line->len] = 0;
@@ -876,7 +883,7 @@ move_back_one_char(InputItem *sym)
                     line->buffer[line->len - 1] = c;
             }
             else {
-                strncpy(line->buffer, &(line->buffer[1]), sym->size - 2);
+                strnmov(line->buffer, &(line->buffer[1]), sym->size - 2);
                 if (c == 0) {
                     line->buffer[sym->size - 1] = 0;
                     line->len--;
@@ -905,7 +912,7 @@ move_back_one_char(InputItem *sym)
 
 
     if (line->len <= sym->size) {
-        strncpy(&line->buffer[line->buff_pntr - 1],
+        strnmov(&line->buffer[line->buff_pntr - 1],
                 &(line->buffer[line->buff_pntr]),
                 line->len - line->buff_pntr);
         if (c == 0)
@@ -914,7 +921,7 @@ move_back_one_char(InputItem *sym)
             line->buffer[line->len - 1] = c;
     }
     else {
-        strncpy(&(line->buffer[line->buff_pntr - 1]),
+        strnmov(&(line->buffer[line->buff_pntr - 1]),
                 &(line->buffer[line->buff_pntr]),
                 sym->size - line->buff_pntr);
         if (c == 0) {
@@ -1040,7 +1047,7 @@ delete_one_char(InputItem *sym)
      * exists at the end
      */
     if (line->len <= sym->size) {
-        strncpy(&line->buffer[line->buff_pntr],
+        strnmov(&line->buffer[line->buff_pntr],
                 &(line->buffer[line->buff_pntr + 1]),
                 line->len - line->buff_pntr);
         if (c == 0)
@@ -1049,7 +1056,7 @@ delete_one_char(InputItem *sym)
             line->buffer[line->len - 1] = c;
     }
     else {
-        strncpy(&(line->buffer[line->buff_pntr]),
+        strnmov(&(line->buffer[line->buff_pntr]),
                 &(line->buffer[line->buff_pntr + 1]),
                 sym->size - line->buff_pntr);
         if (c == 0) {
diff --git a/src/hyper/extent1.c b/src/hyper/extent1.c
index 0642957c..95766791 100644
--- a/src/hyper/extent1.c
+++ b/src/hyper/extent1.c
@@ -1319,12 +1319,9 @@ compute_header_extent(HyperDocPage *page)
      * for the header here
      */
 
-    int ty; /* UNUSED */
-
     gExtentRegion = Header;
     right_margin_space = non_scroll_right_margin_space;
     init_extents();
-    ty = text_y = 3 * top_margin + line_height + max(page->title->height, twheight);
     gLineNode = page->header->next;
     compute_text_extent(page->header->next);
     page->header->height = text_height(page->header->next,
diff --git a/src/hyper/htadd.c b/src/hyper/htadd.c
index 21321ae7..b3a5962a 100644
--- a/src/hyper/htadd.c
+++ b/src/hyper/htadd.c
@@ -94,7 +94,7 @@ main(int argc, char **argv)
    using namespace OpenAxiom;
     /*int i;*/
     char db_dir[256];           /* the directory where the db file is */
-    char dbfilename[256];       /* the database filename */
+    char dbfilename[512];       /* the database filename */
     char *filenames[1000];      /* the files to be added */
     char **fnames = filenames;
     short flag;                 /* flag for deleting or adding */
diff --git a/src/hyper/hthits.c b/src/hyper/hthits.c
index 470bf297..4e628b16 100644
--- a/src/hyper/hthits.c
+++ b/src/hyper/hthits.c
@@ -220,7 +220,7 @@ handlePage(FILE* infile, PgInfo* pg)
    static char *pgBuf = 0;
    static int pgBufSize = 0;
    
-   char *title, *body;
+   char *title = NULL, *body = NULL;
    
    if (pg->size > pgBufSize - 1) {
       if (pgBuf)
diff --git a/src/hyper/htinp.c b/src/hyper/htinp.c
index 7799c194..b44047f8 100644
--- a/src/hyper/htinp.c
+++ b/src/hyper/htinp.c
@@ -439,7 +439,7 @@ send_command(char *command,int com_type)
     }
     else {
         FILE *f;
-        char name[512], str[512]/*, *c*/;
+        char name[512], str[1024]/*, *c*/;
 
         sprintf(name, "/tmp/hyper%s.input", oa_getenv("SPADNUM"));
         f = fopen(name, "w");
diff --git a/src/hyper/initx.c b/src/hyper/initx.c
index 0ee4afa0..c69c2071 100644
--- a/src/hyper/initx.c
+++ b/src/hyper/initx.c
@@ -1018,7 +1018,7 @@ is_it_850(XFontStruct *fontarg)
 /* return 1 if it is 850 */
 
     s = XGetAtomName(gXDisplay,(Atom)fontarg->properties[i].card32);
-    val = !( strcmp("850",s) * strcmp("ibm-850",s));
+    val = !( strcmp("850",s) && strcmp("ibm-850",s));
     XFree(s);
     return( val );
   }
diff --git a/src/hyper/keyin.c b/src/hyper/keyin.c
index eef07e7b..fa8af8de 100644
--- a/src/hyper/keyin.c
+++ b/src/hyper/keyin.c
@@ -82,7 +82,7 @@ unsigned int UnsupportedModMask = LockMask | ControlMask
 static unsigned int
 get_modifier_mask(KeySym sym)
 {
-   unsigned int       i, mask;
+   unsigned int       mask;
    XModifierKeymap    *mod;
    KeyCode            kcode;
    const int          masks[8] = {
@@ -94,7 +94,7 @@ get_modifier_mask(KeySym sym)
    kcode = XKeysymToKeycode(gXDisplay,sym);
    
    if (mod) {
-      for (i = 0; i < (8 * mod->max_keypermod); i++){
+      for (int i = 0; i < (8 * mod->max_keypermod); i++){
          if (!mod->modifiermap[i]) continue;
          else if (kcode == mod->modifiermap[i]){
             mask = masks[i / mod->max_keypermod];
diff --git a/src/hyper/lex.c b/src/hyper/lex.c
index d571e6cd..ed281403 100644
--- a/src/hyper/lex.c
+++ b/src/hyper/lex.c
@@ -435,7 +435,7 @@ AGAIN:
         input_string = sock_buf;
         goto AGAIN;
       default:
-        fprintf(stderr, "Get Char: Unknown type of input: %d\n", input_type);
+        fprintf(stderr, "Get Char: Unknown type of input: %d\n", (int)input_type);
         return -1;
     }
 }
diff --git a/src/hyper/macro.c b/src/hyper/macro.c
index 0b0d1889..7bf0f77b 100644
--- a/src/hyper/macro.c
+++ b/src/hyper/macro.c
@@ -101,7 +101,6 @@ number(const char *str)
 static char *
 load_macro(MacroStore *macro)
 {
-    int ret_val;
     long start_fpos;
     int size = 0;
     char *trace;
@@ -158,7 +157,7 @@ load_macro(MacroStore *macro)
     }
     start_fpos = fpos;
     scan_HyperDoc();
-    ret_val = fseek(cfile, macro->fpos.pos + start_fpos, 0);
+    fseek(cfile, macro->fpos.pos + start_fpos, 0);
     size = fpos - start_fpos;
     macro_buff = (char *) halloc((size + 1) * sizeof(char), "Macro_buf");
     for (size = 0, trace = macro_buff; size < fpos - (start_fpos) - 1; size++)
diff --git a/src/hyper/parse-aux.c b/src/hyper/parse-aux.c
index 4c7600b9..24efcf89 100644
--- a/src/hyper/parse-aux.c
+++ b/src/hyper/parse-aux.c
@@ -512,7 +512,6 @@ int
 get_filename()
 {
     int c, ws;
-    static int seen_white = 0; /*UNUSED */
     static char buffer[256];
     char *buf = buffer;
 
@@ -524,8 +523,6 @@ get_filename()
         keyword_fpos = fpos;
         c = get_char();
         ws = whitespace(c);
-        if (ws)
-            seen_white = 1;
     } while (ws);
     switch (c) {
       case EOF:
@@ -545,7 +542,6 @@ get_filename()
         *buf = '\0';
         token.type = openaxiom_Word_token;
         token.id = buffer;
-        seen_white = 0;
         break;
     }
     return 1;
diff --git a/src/hyper/parse-input.c b/src/hyper/parse-input.c
index 1c619151..727acc9d 100644
--- a/src/hyper/parse-input.c
+++ b/src/hyper/parse-input.c
@@ -562,9 +562,9 @@ parse_radioboxes()
 
   /* quick search for the name in the current list */
   if (already_there(newrb->name)) {
+    fprintf(stderr, "Tried to redefine radioboxes %s\n", newrb->name);
     free(newrb->name);
     free(newrb);
-    fprintf(stderr, "Tried to redefine radioboxes %s\n", newrb->name);
     print_page_and_filename();
     jump();
   }
diff --git a/src/hyper/parse-types.c b/src/hyper/parse-types.c
index f5a42cd9..e42d93f9 100644
--- a/src/hyper/parse-types.c
+++ b/src/hyper/parse-types.c
@@ -196,9 +196,9 @@ parse_condnode()
         break;
       default:
         {
-            char eb[128];
+            char eb[160];
             token_name(token.type);
-            sprintf(eb, "Unexpected Token %s\n", eb);
+            sprintf(eb, "Unexpected Token %s\n", ebuffer);
             htperror(eb, HTCONDNODE);
         }
         break;
diff --git a/src/hyper/parse.c b/src/hyper/parse.c
index 1ca0f77e..cddaa8ae 100644
--- a/src/hyper/parse.c
+++ b/src/hyper/parse.c
@@ -298,8 +298,8 @@ parse_header(HyperDocPage *page)
 static void
 init_parse_page(HyperDocPage *page)
 {
-    gEndedPage = gInDesc = gStringValueOk = gInIf =
-        gInButton = gInOptional = gInVerbatim = gInPaste = gInItems =
+    gEndedPage = false; gInDesc = false; gStringValueOk = false; gInIf = false;
+        gInButton = false; gInOptional = false; gInVerbatim = false; gInPaste = false; gInItems = false;
         gInSpadsrc = false;
     example_number = 1;
     cur_page = page;
@@ -325,8 +325,8 @@ init_parse_page(HyperDocPage *page)
 void
 init_parse_patch(HyperDocPage *page)
 {
-    gEndedPage = gInDesc = gStringValueOk = gInIf =
-        gInButton = gInOptional = gInVerbatim = gInPaste = gInItems =
+    gEndedPage = false; gInDesc = false; gStringValueOk = false; gInIf = false;
+        gInButton = false; gInOptional = false; gInVerbatim = false; gInPaste = false; gInItems = false;
         gInSpadsrc = false;
     gParserMode = AllMode;
     gParserRegion = Scrolling;
diff --git a/src/hyper/show-types.c b/src/hyper/show-types.c
index 1942901b..e34498d8 100644
--- a/src/hyper/show-types.c
+++ b/src/hyper/show-types.c
@@ -464,10 +464,8 @@ show_input(TextNode *node)
     /*Window root, child;*/
     /*int root_x, root_y, win_x, win_y, buttons;*/
     InputItem *item;
-    char *inpbuffer;
 
     item = node->link->reference.string;
-    inpbuffer = item->curr_line->buffer;
 
     wc.border_width = 0;
     wc.x = node->x;
diff --git a/src/hyper/spadint.c b/src/hyper/spadint.c
index aa381ba0..df2cd526 100644
--- a/src/hyper/spadint.c
+++ b/src/hyper/spadint.c
@@ -137,7 +137,7 @@ static void
 send_pile(openaxiom_sio *sock,char * str)
 {
     FILE *f;
-    char name[512], command[512];
+    char name[512], command[532];
 
     sprintf(name, "/tmp/hyper%s.input", oa_getenv("SPADNUM"));
     f = fopen(name, "w");
@@ -218,7 +218,7 @@ start_user_buffer(HyperDocPage *page)
 
     SPAD = (char *) oa_getenv("AXIOM");
     if (SPAD == NULL) {
-        sprintf(SPAD, "/spad/mnt/rios");
+        SPAD = "/spad/mnt/rios";
     }
     sprintf(spadbuf, "%s/lib/spadbuf", SPAD);
     sprintf(complfile, "%s/lib/command.list", SPAD);
@@ -542,16 +542,18 @@ print_to_string1(TextNode *command,int * sizeBuf)
           case openaxiom_StringValue_token:
             item = return_item(node->data.text);
             if (item != NULL) {
-                if (node->space)
+                if (node->space) {
                     storeChar(' ');
+                }
                 curr_line = item->lines;
                 while (curr_line != NULL) {
                     for (lcount = 0, s = curr_line->buffer; *s && lcount < item->size;
                          s++, lcount++) {
                         storeChar(funnyUnescape(*s));
                     }
-                    if (curr_line->len <= item->size && curr_line->next)
+                    if (curr_line->len <= item->size && curr_line->next) {
                         storeChar('\n');
+                    }
                     curr_line = curr_line->next;
                 }
             }
@@ -1032,8 +1034,9 @@ print_source_to_string1(TextNode *command,int * sizeBuf)
                          s++, lcount++) {
                         storeChar(funnyUnescape(*s));
                     }
-                    if (curr_line->len <= item->size && curr_line->next)
+                    if (curr_line->len <= item->size && curr_line->next) {
                         storeChar('\n');
+                    }
                     curr_line = curr_line->next;
                 }
             }
diff --git a/src/include/edin.h b/src/include/edin.h
index 65f77aeb..f010aa2a 100644
--- a/src/include/edin.h
+++ b/src/include/edin.h
@@ -49,6 +49,8 @@ extern int convert_buffer(char *  , char *  , int *  , int );
 extern void init_buff(char *  , int );
 extern void forwardcopy(char *  , char *  , int );
 extern void forwardflag_cpy(int *  ,int *  , int );
+extern void strmov(char *, const char*);
+extern void strnmov(char *, const char*, size_t);
 extern void flagcpy(int *  , int * );
 extern void flagncpy(int *  , int *  , int );
 extern void send_function_to_child(void);
diff --git a/src/include/open-axiom/token b/src/include/open-axiom/token
index a586fa6d..7f379593 100644
--- a/src/include/open-axiom/token
+++ b/src/include/open-axiom/token
@@ -483,13 +483,15 @@ namespace OpenAxiom {
             comment_token(t, TokenValue::Commentary);
             pos.column = frag(pos).length();
             break;
-         case '-':
-            if (pos.column + 1 < frag(pos).size()
-                and frag(pos)[pos.column + 1] == '>') {
+         case '-': {
+            std::size_t c = pos.column + 1;
+            if (c < frag(pos).size()
+                and frag(pos)[c] == '>') {
                t.value = TokenValue::MapsTo;
                pos.column += 2;
             }
             break;
+                   }
          default: break;
          }
    }
diff --git a/src/include/spadcolors.h b/src/include/spadcolors.h
index 63621599..a9541e73 100644
--- a/src/include/spadcolors.h
+++ b/src/include/spadcolors.h
@@ -50,13 +50,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define startColor 0
 #define endColor   (startColor+numColors)
 
-#define colorStep ((maxColors+1)/numColors)
-
 #define yes 1
 #define no 0
 
 #define smoothConst  50
+#ifndef saymem
 #define saymem(a,b,c) saymemWithLine(a,b,c,0)
+#endif
 #define Colorcells 256   /* KF number of elements in permutation vector */
 /* #define shade 5  */
 #define saturation   0.8
@@ -76,6 +76,4 @@ extern Colormap  colorMap;
 extern int       num;
 extern int       scrn;
 
-#define maxColors DisplayCells(dsply,scrn)-1
-
 #endif  /* OPENAXIOM_SPADCOLORS_included */
diff --git a/src/io/InputFragment.cxx b/src/io/InputFragment.cxx
index 595b88b1..827aa372 100644
--- a/src/io/InputFragment.cxx
+++ b/src/io/InputFragment.cxx
@@ -76,16 +76,18 @@ namespace OpenAxiom {
 
    // Return true if line is entirely a positive comment, i.e. a description.
    static bool positive_comment(const Line& line) {
-      if (line.indent + 1 >= line.length())
+      std::size_t i = line.indent + 1;
+      if (i >= line.length())
          return false;
-      return line[line.indent] == '+' and line[line.indent + 1] == '+';
+      return line[line.indent] == '+' and line[i] == '+';
    }
 
    // Return true if line is entirely a negative comment.
    static bool negative_comment(const Line& line) {
-      if (line.indent + 1 >= line.length())
+      std::size_t i = line.indent + 1;
+      if (i >= line.length())
          return false;
-      return line[line.indent] == '-' and line[line.indent + 1] == '-';
+      return line[line.indent] == '-' and line[i] == '-';
    }
    
    // Clean up and dress up the line with indentation information.
diff --git a/src/lib/cfuns-c.cxx b/src/lib/cfuns-c.cxx
index 11c28691..5dbcd6bc 100644
--- a/src/lib/cfuns-c.cxx
+++ b/src/lib/cfuns-c.cxx
@@ -79,11 +79,6 @@
 #endif
 
 namespace OpenAxiom {
-   // Make a copy of string data on free store.
-   static char*
-   copy_c_str(const std::string& s) {
-      return strdup(s.c_str());
-   }
 
 OPENAXIOM_C_EXPORT int
 addtopath(char *dir)
diff --git a/src/lib/edin.c b/src/lib/edin.c
index f85a632a..568bb77a 100644
--- a/src/lib/edin.c
+++ b/src/lib/edin.c
@@ -792,6 +792,18 @@ forwardflag_cpy(int *buff1,int * buff2,int  num)
     buff1[count] = buff2[count];
 }
 
+void
+strnmov(char *dest, const char *src, size_t n)
+{
+  while (n-- && (*dest++ = *src++));
+}
+
+void
+strmov(char *dest, const char *src)
+{
+  while ((*dest++ = *src++));
+}
+
 void 
 flagcpy(int *s,int *t)
 {
diff --git a/src/lib/prt.c b/src/lib/prt.c
index f111e2d9..ee5b3af0 100644
--- a/src/lib/prt.c
+++ b/src/lib/prt.c
@@ -152,7 +152,7 @@ delete_current_char(void)
         if (buff_flag[curr_pntr] == 1 || buff_flag[curr_pntr] == 0) {
             myputchar(_BLANK);
             myputchar(_BKSPC);
-            strcpy(&buff[curr_pntr],
+            strmov(&buff[curr_pntr],
                    &buff[curr_pntr + 1]);
             flagcpy(&buff_flag[curr_pntr],
                     &buff_flag[curr_pntr + 1]);
@@ -165,7 +165,7 @@ delete_current_char(void)
             myputchar(_BLANK);
             myputchar(_BKSPC);
             myputchar(_BKSPC);
-            strcpy(&buff[curr_pntr],
+            strmov(&buff[curr_pntr],
                    &buff[curr_pntr + 2]);
             flagcpy(&buff_flag[curr_pntr],
                     &buff_flag[curr_pntr + 2]);
@@ -380,7 +380,7 @@ back_over_current_char(void)
             myputchar(_BLANK);
             myputchar(_BKSPC);
             myputchar(_BKSPC);
-            strcpy(&buff[curr_pntr - 2],
+            strmov(&buff[curr_pntr - 2],
                    &buff[curr_pntr]);
             flagcpy(&buff_flag[curr_pntr - 2],
                     &buff_flag[curr_pntr]);
@@ -392,7 +392,7 @@ back_over_current_char(void)
             myputchar(_BKSPC);
             myputchar(_BLANK);
             myputchar(_BKSPC);
-            strcpy(&buff[curr_pntr - 1],
+            strmov(&buff[curr_pntr - 1],
                    &buff[curr_pntr]);
             flagcpy(&buff_flag[curr_pntr - 1],
                     &buff_flag[curr_pntr]);
diff --git a/src/lib/sockio-c.cxx b/src/lib/sockio-c.cxx
index 24b8f475..dda95ec3 100644
--- a/src/lib/sockio-c.cxx
+++ b/src/lib/sockio-c.cxx
@@ -1123,7 +1123,7 @@ init_purpose_table()
 OPENAXIOM_C_EXPORT int 
 make_server_number()
 {
-  spad_server_number = oa_getpid();
+  spad_server_number = oa_getpid() % 1024;
   return spad_server_number;
 }
 
diff --git a/src/lib/wct.c b/src/lib/wct.c
index 35cc01e9..44510558 100644
--- a/src/lib/wct.c
+++ b/src/lib/wct.c
@@ -572,7 +572,7 @@ rescan_wct(void)
         else if (new_len < old_len) {
             /* this time I simply copy backwards and do the substituting */
             diff = old_len - new_len;
-            strncpy(&buff[curr_pntr - diff],
+            strnmov(&buff[curr_pntr - diff],
                     &buff[curr_pntr],
                     buff_pntr - curr_pntr);
             flagncpy(&buff_flag[curr_pntr - diff],
diff --git a/src/rt/Lisp.cc b/src/rt/Lisp.cc
index fae3e02f..045d087c 100644
--- a/src/rt/Lisp.cc
+++ b/src/rt/Lisp.cc
@@ -327,7 +327,7 @@ namespace OpenAxiom {
             unimplemented(x);
          if (auto op = special_operator(*s))
             return op(ctx, x);
-         auto fun = symbol_function(ctx, *s);
+         return to_value( symbol_function(ctx, *s));
       }
 
       Value
diff --git a/src/sman/session.c b/src/sman/session.c
index e7edf001..20a29307 100644
--- a/src/sman/session.c
+++ b/src/sman/session.c
@@ -105,6 +105,7 @@ term_handler(int sig)
   exit(1);
 }
 
+#ifdef DEBUG
 static void
 pr()
 {
@@ -116,6 +117,7 @@ pr()
   }
   fprintf(stderr,"\n");
 }
+#endif
 
 static void
 close_client(int frame)
diff --git a/src/syntax/Parser.cxx b/src/syntax/Parser.cxx
index ada3963b..be73b088 100644
--- a/src/syntax/Parser.cxx
+++ b/src/syntax/Parser.cxx
@@ -72,24 +72,6 @@ namespace {
       TokenSequence::size_type position;
    };
 
-   const Token* next_token(ParsingContext& ctx) {
-      while (auto t = ctx.current_token()) {
-         switch (t->category) {
-         case TokenCategory::Whitespace:
-            break;
-
-         case TokenCategory::Comment:
-            if (t->value == TokenValue::Wisecrack)
-               break;
-
-         default:
-            return t;
-         }
-         ctx.advance();
-      }
-      return nullptr;
-   }
-
    // Simple wrapper around standard file streams, along with the pathname
    // to the file.
    template<typename T>
diff --git a/src/utils/command.cc b/src/utils/command.cc
index f560f169..55716bc1 100644
--- a/src/utils/command.cc
+++ b/src/utils/command.cc
@@ -302,7 +302,7 @@ static void print_usage(void) {
    print_line("  --optimize=<n>   Set compiler optimization level to <n>, a natural number.");
    print_line("");
    print_line("If invoked without options and without an input file "
-              "OpenAxiom will start as an interative program with Superman"
+              "OpenAxiom will start as an interactive program with Superman"
               " as the master process, the majority of uses.  If invoked "
               "with a file as single argument, OpenAxiom assumes the file is a Spad "
               "script and will attempt to execute it as such.");