Example #1
0
void
setNLogin(struct display *d,
          const char *nuser, const char *npass, const char *nargs, int rl)
{
    struct disphist *he = d->hstent;
    he->rLogin =
        (reStr(&he->nuser, nuser) &&
         reStr(&he->npass, npass) &&
         reStr(&he->nargs, nargs)) ? rl : 0;
    debug("set next login for %s, level %d\n", nuser, rl);
}
Example #2
0
CString  AsfParser::PgmpuConvert( const CString str) 
{
	WORD   len = str.GetLength();
	BYTE * buf = new BYTE[ len*3];
	char a,b;
    int j=0;
	for( int i=0; i<len; i++) {
		if( str[i]> 0x7f ) {
			a = str[i]/16;
			b = str[i]%16;
			if( a>=10 ) a ='a'+a-10;
			else	  a = '0' + a;
			if( b>=10 ) b= 'a' + b -10;
			else	  b= '0'+b;
			buf[j] = '%';
			buf[j+1] = a;
			buf[j+2] = b;
			j+=3;
		} else {
			buf[j++] = str[i];
		}
	}
	ASSERT( j<= len*3+1 );
	CString reStr((const char *)buf,j);
	reStr.Replace(" ","%20");
	delete[] buf;
	return reStr;
}