diff --git a/Parms.cpp b/Parms.cpp index ac7da6f7..aaeb3964 100644 --- a/Parms.cpp +++ b/Parms.cpp @@ -843,9 +843,9 @@ bool Parms::sendPageGeneric ( TcpSocket *s , HttpRequest *r , long page , " if( i > 0) nombre = name + i;\n" " else nombre = name;\n" " var e = document.getElementById(nombre);\n" - //" e.checked = !e.checked;\n" - " if ( e.value == 'Y' ) e.value='N';" - " else if ( e.value == 'N' ) e.value='Y';" + " e.checked = !e.checked;\n" + //" if ( e.value == 'Y' ) e.value='N';" + //" else if ( e.value == 'N' ) e.value='Y';" " }\n" "}\n" ""); @@ -2716,38 +2716,32 @@ bool Parms::printParm ( SafeBuf* sb, // request. //if ( lastRow && m->m_page == PAGE_FILTERS ) // sb->safePrintf("safePrintf("" + , cgi ); //else - sb->safePrintf(//"safePrintf("m_page == PAGE_FILTERS) sb->safePrintf("id=id_%s ",cgi); - sb->safePrintf("value=%s name=%s " - "onmouseup=\"" - "if ( this.value=='N' ) {" - "this.value='Y';" - //"this.checked=false; " - //"alert ('up'+this.checked); " - //"alert(this.checked); }" - //"return false;" - // prevent from other handle - // from turning it back on!! - //"this.disabled=true;" - //"return false;" - "} " - "else if ( this.value=='Y' ) {" - "this.value='N';" - "}" - "\" " - //"onmousedown=\"" - //"alert('down'+this.checked);" - //"this.checked=true;" - //"this.disabled=false\"; " + sb->safePrintf("name=%s%s" + //" onmouseup=\"" + //"if ( this.value=='N' ) {" + //"this.value='Y';" + //"} " + //"else if ( this.value=='Y' ) {" + //"this.value='N';" + //"}" //"\" " - //"%s>", - ,val,cgi);//,ddd); + ">" + ,cgi + ,val);//,ddd); // // repeat for off position // @@ -16810,6 +16804,8 @@ bool Parms::addNewParmToList2 ( SafeBuf *parmList , val = parmValString; // include \0 valSize = gbstrlen(val)+1; + // sanity + if ( val[valSize-1] != '\0' ) { char *xx=NULL;*xx=0; } } else if ( m->m_type == TYPE_LONG ) { // watch out for unsigned 32-bit numbers, so use atoLL() @@ -16833,10 +16829,10 @@ bool Parms::addNewParmToList2 ( SafeBuf *parmList , m->m_type == TYPE_PRIORITY2 || m->m_type == TYPE_CHAR ) { val8 = atol(parmValString); - if ( parmValString && to_lower_a(parmValString[0]) == 'y' ) - val8 = 1; - if ( parmValString && to_lower_a(parmValString[0]) == 'n' ) - val8 = 0; + //if ( parmValString && to_lower_a(parmValString[0]) == 'y' ) + // val8 = 1; + //if ( parmValString && to_lower_a(parmValString[0]) == 'n' ) + // val8 = 0; val = (char *)&val8; valSize = 1; } @@ -17147,6 +17143,7 @@ bool Parms::convertHttpRequestToParmList (HttpRequest *hr, SafeBuf *parmList, // } //} + // // now add the parms that are NOT commands // @@ -17193,6 +17190,7 @@ bool Parms::convertHttpRequestToParmList (HttpRequest *hr, SafeBuf *parmList, return false; } + return true; } @@ -18250,10 +18248,13 @@ bool Parms::updateParm ( char *rec , WaitEntry *we ) { sb->purge(); // this means that we can not use string POINTERS as parms!! if ( data && dataSize && data[0] ) - sb->safeMemcpy ( data , dataSize ); + // don't include \0 as part of length + sb->safeStrcpy ( data ); // , dataSize ); // ensure null terminated sb->nullTerm(); //return true; + // sanity + if ( data[dataSize-1] != '\0' ) { char *xx=NULL;*xx=0; } } else { // and copy the data into collrec or g_conf