Fossil SCM
Fix usage error message for 'ticket change' and 'ticket history' commands. Also, silence harmless compiler warnings.
Commit
fc5a217602a97cdcf150a39067fae10c6a77ea33
Parent
bb3fe3997be9355…
2 files changed
+3
-3
+1
-1
+3
-3
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -547,12 +547,12 @@ | ||
| 547 | 547 | int argc, |
| 548 | 548 | const char **argv, |
| 549 | 549 | int *argl |
| 550 | 550 | ){ |
| 551 | 551 | int n; |
| 552 | - char aRand[50]; | |
| 553 | - char zOut[100]; | |
| 552 | + unsigned char aRand[50]; | |
| 553 | + unsigned char zOut[100]; | |
| 554 | 554 | if( argc!=1 && argc!=2 ){ |
| 555 | 555 | return Th_WrongNumArgs(interp, "repository ?BOOLEAN?"); |
| 556 | 556 | } |
| 557 | 557 | if( argc==2 ){ |
| 558 | 558 | if( Th_ToInt(interp, argv[1], argl[1], &n) ){ |
| @@ -563,11 +563,11 @@ | ||
| 563 | 563 | }else{ |
| 564 | 564 | n = 10; |
| 565 | 565 | } |
| 566 | 566 | sqlite3_randomness(n, aRand); |
| 567 | 567 | encode16(aRand, zOut, n); |
| 568 | - Th_SetResult(interp, zOut, -1); | |
| 568 | + Th_SetResult(interp, (const char *)zOut, -1); | |
| 569 | 569 | return TH_OK; |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | |
| 573 | 573 | /* |
| 574 | 574 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -547,12 +547,12 @@ | |
| 547 | int argc, |
| 548 | const char **argv, |
| 549 | int *argl |
| 550 | ){ |
| 551 | int n; |
| 552 | char aRand[50]; |
| 553 | char zOut[100]; |
| 554 | if( argc!=1 && argc!=2 ){ |
| 555 | return Th_WrongNumArgs(interp, "repository ?BOOLEAN?"); |
| 556 | } |
| 557 | if( argc==2 ){ |
| 558 | if( Th_ToInt(interp, argv[1], argl[1], &n) ){ |
| @@ -563,11 +563,11 @@ | |
| 563 | }else{ |
| 564 | n = 10; |
| 565 | } |
| 566 | sqlite3_randomness(n, aRand); |
| 567 | encode16(aRand, zOut, n); |
| 568 | Th_SetResult(interp, zOut, -1); |
| 569 | return TH_OK; |
| 570 | } |
| 571 | |
| 572 | |
| 573 | /* |
| 574 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -547,12 +547,12 @@ | |
| 547 | int argc, |
| 548 | const char **argv, |
| 549 | int *argl |
| 550 | ){ |
| 551 | int n; |
| 552 | unsigned char aRand[50]; |
| 553 | unsigned char zOut[100]; |
| 554 | if( argc!=1 && argc!=2 ){ |
| 555 | return Th_WrongNumArgs(interp, "repository ?BOOLEAN?"); |
| 556 | } |
| 557 | if( argc==2 ){ |
| 558 | if( Th_ToInt(interp, argv[1], argl[1], &n) ){ |
| @@ -563,11 +563,11 @@ | |
| 563 | }else{ |
| 564 | n = 10; |
| 565 | } |
| 566 | sqlite3_randomness(n, aRand); |
| 567 | encode16(aRand, zOut, n); |
| 568 | Th_SetResult(interp, (const char *)zOut, -1); |
| 569 | return TH_OK; |
| 570 | } |
| 571 | |
| 572 | |
| 573 | /* |
| 574 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -1012,11 +1012,11 @@ | ||
| 1012 | 1012 | eCmd = history; |
| 1013 | 1013 | }else{ |
| 1014 | 1014 | eCmd = set; |
| 1015 | 1015 | } |
| 1016 | 1016 | if( g.argc==3 ){ |
| 1017 | - usage("set TICKETUUID"); | |
| 1017 | + usage("set|change|history TICKETUUID"); | |
| 1018 | 1018 | } |
| 1019 | 1019 | zTktUuid = db_text(0, |
| 1020 | 1020 | "SELECT tkt_uuid FROM ticket WHERE tkt_uuid GLOB '%s*'", g.argv[3] |
| 1021 | 1021 | ); |
| 1022 | 1022 | if( !zTktUuid ){ |
| 1023 | 1023 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -1012,11 +1012,11 @@ | |
| 1012 | eCmd = history; |
| 1013 | }else{ |
| 1014 | eCmd = set; |
| 1015 | } |
| 1016 | if( g.argc==3 ){ |
| 1017 | usage("set TICKETUUID"); |
| 1018 | } |
| 1019 | zTktUuid = db_text(0, |
| 1020 | "SELECT tkt_uuid FROM ticket WHERE tkt_uuid GLOB '%s*'", g.argv[3] |
| 1021 | ); |
| 1022 | if( !zTktUuid ){ |
| 1023 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -1012,11 +1012,11 @@ | |
| 1012 | eCmd = history; |
| 1013 | }else{ |
| 1014 | eCmd = set; |
| 1015 | } |
| 1016 | if( g.argc==3 ){ |
| 1017 | usage("set|change|history TICKETUUID"); |
| 1018 | } |
| 1019 | zTktUuid = db_text(0, |
| 1020 | "SELECT tkt_uuid FROM ticket WHERE tkt_uuid GLOB '%s*'", g.argv[3] |
| 1021 | ); |
| 1022 | if( !zTktUuid ){ |
| 1023 |