68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
-
+
+
+
-
+
|
int j;
x.u = 0;
if( i >= 0 ){
for(j=7; j >= 0; j--){
x.b[j] = (unsigned char)(uppercase?'A':'a') + i%26;
if( (i /= 26) == 0 ) break;
}
x.u >>= 8*j;
assert( j > 0 ); /* because 2^32 < 26^7 */
for(i=0; i<8-j; i++) x.b[i] = x.b[i+j];
for( ; i<8 ; i++) x.b[i] = 0;
}
x.c[7] = 0;
assert( x.c[7] == 0 );
return x;
}
/* HTML escapes
**
** html_escape() converts < to <, > to >, and & to &.
** html_quote() goes further and converts " into " and ' in '.
|