Fossil SCM

Fix additional problems on the new TH1 implementation.

drh 2025-04-19 23:02 th1-taint
Commit 2c2b6c68b2da554651c3c8b88c725aab63659f8f41d3397ec8d090197865debb
2 files changed +2 -1 +1 -1
+2 -1
--- src/th_main.c
+++ src/th_main.c
@@ -1157,11 +1157,11 @@
11571157
return Th_WrongNumArgs(interp, "combobox NAME TEXT-LIST NUMLINES");
11581158
}
11591159
if( enableOutput ){
11601160
int height;
11611161
Blob name;
1162
- int nValue;
1162
+ int nValue = 0;
11631163
const char *zValue;
11641164
char *z, *zH;
11651165
int nElem;
11661166
int *aszElem;
11671167
char **azElem;
@@ -1169,10 +1169,11 @@
11691169
11701170
if( Th_ToInt(interp, argv[3], argl[3], &height) ) return TH_ERROR;
11711171
Th_SplitList(interp, argv[2], TH1_LEN(argl[2]), &azElem, &aszElem, &nElem);
11721172
blob_init(&name, (char*)argv[1], TH1_LEN(argl[1]));
11731173
zValue = Th_Fetch(blob_str(&name), &nValue);
1174
+ nValue = TH1_LEN(nValue);
11741175
zH = htmlize(blob_buffer(&name), blob_size(&name));
11751176
z = mprintf("<select id=\"%s\" name=\"%s\" size=\"%d\">", zH, zH, height);
11761177
free(zH);
11771178
sendText(0,z, -1, 0);
11781179
free(z);
11791180
--- src/th_main.c
+++ src/th_main.c
@@ -1157,11 +1157,11 @@
1157 return Th_WrongNumArgs(interp, "combobox NAME TEXT-LIST NUMLINES");
1158 }
1159 if( enableOutput ){
1160 int height;
1161 Blob name;
1162 int nValue;
1163 const char *zValue;
1164 char *z, *zH;
1165 int nElem;
1166 int *aszElem;
1167 char **azElem;
@@ -1169,10 +1169,11 @@
1169
1170 if( Th_ToInt(interp, argv[3], argl[3], &height) ) return TH_ERROR;
1171 Th_SplitList(interp, argv[2], TH1_LEN(argl[2]), &azElem, &aszElem, &nElem);
1172 blob_init(&name, (char*)argv[1], TH1_LEN(argl[1]));
1173 zValue = Th_Fetch(blob_str(&name), &nValue);
 
1174 zH = htmlize(blob_buffer(&name), blob_size(&name));
1175 z = mprintf("<select id=\"%s\" name=\"%s\" size=\"%d\">", zH, zH, height);
1176 free(zH);
1177 sendText(0,z, -1, 0);
1178 free(z);
1179
--- src/th_main.c
+++ src/th_main.c
@@ -1157,11 +1157,11 @@
1157 return Th_WrongNumArgs(interp, "combobox NAME TEXT-LIST NUMLINES");
1158 }
1159 if( enableOutput ){
1160 int height;
1161 Blob name;
1162 int nValue = 0;
1163 const char *zValue;
1164 char *z, *zH;
1165 int nElem;
1166 int *aszElem;
1167 char **azElem;
@@ -1169,10 +1169,11 @@
1169
1170 if( Th_ToInt(interp, argv[3], argl[3], &height) ) return TH_ERROR;
1171 Th_SplitList(interp, argv[2], TH1_LEN(argl[2]), &azElem, &aszElem, &nElem);
1172 blob_init(&name, (char*)argv[1], TH1_LEN(argl[1]));
1173 zValue = Th_Fetch(blob_str(&name), &nValue);
1174 nValue = TH1_LEN(nValue);
1175 zH = htmlize(blob_buffer(&name), blob_size(&name));
1176 z = mprintf("<select id=\"%s\" name=\"%s\" size=\"%d\">", zH, zH, height);
1177 free(zH);
1178 sendText(0,z, -1, 0);
1179 free(z);
1180
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -938,11 +938,11 @@
938938
const char *zValue;
939939
int nValue;
940940
if( aField[i].zAppend ) continue;
941941
zValue = Th_Fetch(aField[i].zName, &nValue);
942942
if( zValue ){
943
- int nValue = TH1_LEN(nValue);
943
+ nValue = TH1_LEN(nValue);
944944
while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; }
945945
if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0)
946946
|| memcmp(zValue, aField[i].zValue, nValue)!=0
947947
||(int)strlen(aField[i].zValue)!=nValue
948948
){
949949
--- src/tkt.c
+++ src/tkt.c
@@ -938,11 +938,11 @@
938 const char *zValue;
939 int nValue;
940 if( aField[i].zAppend ) continue;
941 zValue = Th_Fetch(aField[i].zName, &nValue);
942 if( zValue ){
943 int nValue = TH1_LEN(nValue);
944 while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; }
945 if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0)
946 || memcmp(zValue, aField[i].zValue, nValue)!=0
947 ||(int)strlen(aField[i].zValue)!=nValue
948 ){
949
--- src/tkt.c
+++ src/tkt.c
@@ -938,11 +938,11 @@
938 const char *zValue;
939 int nValue;
940 if( aField[i].zAppend ) continue;
941 zValue = Th_Fetch(aField[i].zName, &nValue);
942 if( zValue ){
943 nValue = TH1_LEN(nValue);
944 while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; }
945 if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0)
946 || memcmp(zValue, aField[i].zValue, nValue)!=0
947 ||(int)strlen(aField[i].zValue)!=nValue
948 ){
949

Keyboard Shortcuts

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