Fossil SCM

Add a blank entry to the end of the Setting array so that loops can be terminated by checking for a null zName pointer.

drh 2017-10-30 13:20 trunk
Commit df654bd9938d9dca655c635da522c78345045f37f82bd7d5954f95bf8348bdb3
2 files changed +1 -1 +1 -1
+1 -1
--- src/dispatch.c
+++ src/dispatch.c
@@ -657,8 +657,8 @@
657657
**
658658
** This routine provides access to the aSetting2[] array which is created
659659
** by the mkindex utility program and included with <page_index.h>.
660660
*/
661661
const Setting *setting_info(int *pnCount){
662
- if( pnCount ) *pnCount = (int)(sizeof(aSetting)/sizeof(aSetting[0]));
662
+ if( pnCount ) *pnCount = (int)(sizeof(aSetting)/sizeof(aSetting[0])) - 1;
663663
return aSetting;
664664
}
665665
--- src/dispatch.c
+++ src/dispatch.c
@@ -657,8 +657,8 @@
657 **
658 ** This routine provides access to the aSetting2[] array which is created
659 ** by the mkindex utility program and included with <page_index.h>.
660 */
661 const Setting *setting_info(int *pnCount){
662 if( pnCount ) *pnCount = (int)(sizeof(aSetting)/sizeof(aSetting[0]));
663 return aSetting;
664 }
665
--- src/dispatch.c
+++ src/dispatch.c
@@ -657,8 +657,8 @@
657 **
658 ** This routine provides access to the aSetting2[] array which is created
659 ** by the mkindex utility program and included with <page_index.h>.
660 */
661 const Setting *setting_info(int *pnCount){
662 if( pnCount ) *pnCount = (int)(sizeof(aSetting)/sizeof(aSetting[0])) - 1;
663 return aSetting;
664 }
665
+1 -1
--- src/mkindex.c
+++ src/mkindex.c
@@ -480,11 +480,11 @@
480480
);
481481
if( aEntry[i].zIf ){
482482
printf("#endif\n");
483483
}
484484
}
485
- printf("};\n");
485
+ printf("{0,0,0,0,0,0}};\n");
486486
487487
}
488488
489489
/*
490490
** Process a single file of input
491491
--- src/mkindex.c
+++ src/mkindex.c
@@ -480,11 +480,11 @@
480 );
481 if( aEntry[i].zIf ){
482 printf("#endif\n");
483 }
484 }
485 printf("};\n");
486
487 }
488
489 /*
490 ** Process a single file of input
491
--- src/mkindex.c
+++ src/mkindex.c
@@ -480,11 +480,11 @@
480 );
481 if( aEntry[i].zIf ){
482 printf("#endif\n");
483 }
484 }
485 printf("{0,0,0,0,0,0}};\n");
486
487 }
488
489 /*
490 ** Process a single file of input
491

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button