corrected harmless glitches

This commit is contained in:
hyung-hwan 2016-04-26 13:30:29 +00:00
parent cfc92b99b7
commit 8b417bab8f
2 changed files with 11 additions and 11 deletions

View File

@ -293,7 +293,7 @@ static qse_mchar_t* parse_initial_line (qse_htrd_t* htrd, qse_mchar_t* line)
} }
/* if the line does not end with a new line, it is a bad request */ /* if the line does not end with a new line, it is a bad request */
if (*p != QSE_T('\n')) goto badre; if (*p != QSE_MT('\n')) goto badre;
/* null-terminate the message */ /* null-terminate the message */
((qse_mchar_t*)tmp.ptr)[tmp.len] = QSE_MT('\0'); ((qse_mchar_t*)tmp.ptr)[tmp.len] = QSE_MT('\0');
@ -462,7 +462,7 @@ static qse_mchar_t* parse_initial_line (qse_htrd_t* htrd, qse_mchar_t* line)
while (is_space_octet(*p)) p++; while (is_space_octet(*p)) p++;
/* if the line does not end with a new line, it is a bad request */ /* if the line does not end with a new line, it is a bad request */
if (*p != QSE_T('\n')) goto badre; if (*p != QSE_MT('\n')) goto badre;
((qse_mchar_t*)tmp.ptr)[tmp.len] = QSE_MT('\0'); ((qse_mchar_t*)tmp.ptr)[tmp.len] = QSE_MT('\0');
htrd->re.verstr = tmp.ptr; htrd->re.verstr = tmp.ptr;

View File

@ -245,7 +245,7 @@ int qse_parsehttprange (const qse_mchar_t* str, qse_http_range_t* range)
} }
while (QSE_ISMDIGIT(*str)); while (QSE_ISMDIGIT(*str));
} }
else to = QSE_TYPE_MAX(qse_ulong_t); else to = QSE_TYPE_MAX(qse_http_range_int_t);
if (from > to) return -1; if (from > to) return -1;
@ -397,7 +397,7 @@ int qse_isperencedhttpstr (const qse_mchar_t* str)
{ {
const qse_mchar_t* p = str; const qse_mchar_t* p = str;
while (*p != QSE_T('\0')) while (*p != QSE_MT('\0'))
{ {
if (*p == QSE_MT('%') && *(p + 1) != QSE_MT('\0') && *(p + 2) != QSE_MT('\0')) if (*p == QSE_MT('%') && *(p + 1) != QSE_MT('\0') && *(p + 2) != QSE_MT('\0'))
{ {
@ -422,7 +422,7 @@ qse_size_t qse_perdechttpstr (const qse_mchar_t* str, qse_mchar_t* buf, qse_size
qse_mchar_t* out = buf; qse_mchar_t* out = buf;
qse_size_t dec_count = 0; qse_size_t dec_count = 0;
while (*p != QSE_T('\0')) while (*p != QSE_MT('\0'))
{ {
if (*p == QSE_MT('%') && *(p + 1) != QSE_MT('\0') && *(p + 2) != QSE_MT('\0')) if (*p == QSE_MT('%') && *(p + 1) != QSE_MT('\0') && *(p + 2) != QSE_MT('\0'))
{ {
@ -453,8 +453,8 @@ qse_size_t qse_perdechttpstr (const qse_mchar_t* str, qse_mchar_t* buf, qse_size
(((c) >= QSE_MT('A') && (c) <= QSE_MT('Z')) || \ (((c) >= QSE_MT('A') && (c) <= QSE_MT('Z')) || \
((c) >= QSE_MT('a') && (c) <= QSE_MT('z')) || \ ((c) >= QSE_MT('a') && (c) <= QSE_MT('z')) || \
((c) >= QSE_MT('0') && (c) <= QSE_MT('9')) || \ ((c) >= QSE_MT('0') && (c) <= QSE_MT('9')) || \
(c) == QSE_MT('-') || (c) == QSE_T('_') || \ (c) == QSE_MT('-') || (c) == QSE_MT('_') || \
(c) == QSE_MT('.') || (c) == QSE_T('~')) (c) == QSE_MT('.') || (c) == QSE_MT('~'))
#define TO_HEX(v) (QSE_MT("0123456789ABCDEF")[(v) & 15]) #define TO_HEX(v) (QSE_MT("0123456789ABCDEF")[(v) & 15])
@ -469,7 +469,7 @@ qse_size_t qse_perenchttpstr (int opt, const qse_mchar_t* str, qse_mchar_t* buf,
if (opt & QSE_PERENCHTTPSTR_KEEP_SLASH) if (opt & QSE_PERENCHTTPSTR_KEEP_SLASH)
{ {
while (*p != QSE_T('\0')) while (*p != QSE_MT('\0'))
{ {
if (IS_UNRESERVED(*p) || *p == QSE_MT('/')) *out++ = *p; if (IS_UNRESERVED(*p) || *p == QSE_MT('/')) *out++ = *p;
else else
@ -484,7 +484,7 @@ qse_size_t qse_perenchttpstr (int opt, const qse_mchar_t* str, qse_mchar_t* buf,
} }
else else
{ {
while (*p != QSE_T('\0')) while (*p != QSE_MT('\0'))
{ {
if (IS_UNRESERVED(*p)) *out++ = *p; if (IS_UNRESERVED(*p)) *out++ = *p;
else else
@ -511,14 +511,14 @@ qse_mchar_t* qse_perenchttpstrdup (int opt, const qse_mchar_t* str, qse_mmgr_t*
/* count the number of characters that should be encoded */ /* count the number of characters that should be encoded */
if (opt & QSE_PERENCHTTPSTR_KEEP_SLASH) if (opt & QSE_PERENCHTTPSTR_KEEP_SLASH)
{ {
for (len = 0; str[len] != QSE_T('\0'); len++) for (len = 0; str[len] != QSE_MT('\0'); len++)
{ {
if (!IS_UNRESERVED(str[len]) && str[len] != QSE_MT('/')) count++; if (!IS_UNRESERVED(str[len]) && str[len] != QSE_MT('/')) count++;
} }
} }
else else
{ {
for (len = 0; str[len] != QSE_T('\0'); len++) for (len = 0; str[len] != QSE_MT('\0'); len++)
{ {
if (!IS_UNRESERVED(str[len])) count++; if (!IS_UNRESERVED(str[len])) count++;
} }