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.
Commit
df654bd9938d9dca655c635da522c78345045f37f82bd7d5954f95bf8348bdb3
Parent
266a311b62e1feb…
2 files changed
+1
-1
+1
-1
+1
-1
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -657,8 +657,8 @@ | ||
| 657 | 657 | ** |
| 658 | 658 | ** This routine provides access to the aSetting2[] array which is created |
| 659 | 659 | ** by the mkindex utility program and included with <page_index.h>. |
| 660 | 660 | */ |
| 661 | 661 | 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; | |
| 663 | 663 | return aSetting; |
| 664 | 664 | } |
| 665 | 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])); |
| 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 @@ | ||
| 480 | 480 | ); |
| 481 | 481 | if( aEntry[i].zIf ){ |
| 482 | 482 | printf("#endif\n"); |
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | - printf("};\n"); | |
| 485 | + printf("{0,0,0,0,0,0}};\n"); | |
| 486 | 486 | |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | /* |
| 490 | 490 | ** Process a single file of input |
| 491 | 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("};\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 |