diff options
Diffstat (limited to 'WWW/Library/Implementation/HTGopher.c')
-rw-r--r-- | WWW/Library/Implementation/HTGopher.c | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c index 0ccdfd56..e023a618 100644 --- a/WWW/Library/Implementation/HTGopher.c +++ b/WWW/Library/Implementation/HTGopher.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTGopher.c,v 1.45 2010/04/30 00:00:41 tom Exp $ + * $LynxId: HTGopher.c,v 1.46 2010/06/16 23:45:31 tom Exp $ * * GOPHER ACCESS HTGopher.c * ============= @@ -313,7 +313,7 @@ static void parse_menu(const char *arg GCC_UNUSED, /* gtype and name ok */ /* Nameless files are a separator line */ if (name != NULL && gtype == GOPHER_TEXT) { - int i = strlen(name) - 1; + int i = (int) strlen(name) - 1; while (name[i] == ' ' && i >= 0) name[i--] = '\0'; @@ -699,11 +699,11 @@ static void de_escape(char *command, const char *selector) p++; c = *p++; - b = from_hex(c); + b = UCH(from_hex(c)); c = *p++; if (!c) break; /* Odd number of chars! */ - *q++ = (char) FROMASCII((b << 4) + from_hex(c)); + *q++ = (char) FROMASCII((b << 4) + UCH(from_hex(c))); } else { *q++ = *p++; /* Record */ } @@ -769,7 +769,7 @@ static void interpret_cso_key(const char *key, error = 1; } if (!error) { - *length = strlen(buf); + *length = (int) strlen(buf); return; } } @@ -855,16 +855,14 @@ static void interpret_cso_key(const char *key, buf[out++] = (*key++); if (out > sizeof(buf) - 2) { buf[out] = '\0'; - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); out = 0; } } buf[out++] = ')'; buf[out] = '\0'; - *length = strlen(buf); - return; } - *length = strlen(buf); + *length = (int) strlen(buf); return; } @@ -1149,7 +1147,7 @@ static int generate_cso_form(char *host, */ buf[out] = '\0'; if (out > 0) - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); for (key = &line[j]; line[j + 1] && (line[j] != ')'); j++) { ; } @@ -1162,21 +1160,21 @@ static int generate_cso_form(char *host, i = ctx.cur_line; j = ctx.cur_off; line = ctemplate[i]; - out = length; + out = (size_t) length; if (ctx.seek) { /* * Command wants us to skip (forward) to indicated token. * Start at current position. */ - int slen = strlen(ctx.seek); + size_t slen = strlen(ctx.seek); for (; ctemplate[i]; i++) { for (line = ctemplate[i]; line[j]; j++) { if (line[j] == '$') if (0 == strncmp(ctx.seek, &line[j], slen)) { if (j == 0) - j = strlen(ctemplate[--i]) - 1; + j = (int) strlen(ctemplate[--i]) - 1; else --j; line = ctemplate[i]; @@ -1192,7 +1190,7 @@ static int generate_cso_form(char *host, char *temp = 0; HTSprintf0(&temp, GOPHER_CSO_SEEK_FAILED, ctx.seek); - (*Target->isa->put_block) (Target, temp, strlen(temp)); + (*Target->isa->put_block) (Target, temp, (int) strlen(temp)); FREE(temp); } } @@ -1203,7 +1201,7 @@ static int generate_cso_form(char *host, buf[out++] = line[j]; if (out > (sizeof(buf) - 3)) { buf[out] = '\0'; - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); out = 0; } } @@ -1212,7 +1210,7 @@ static int generate_cso_form(char *host, buf[out] = '\0'; } if (out > 0) - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); return 0; } @@ -1262,7 +1260,7 @@ static int generate_cso_report(HTStream *Target) } rcode = (p[0] == '-') ? &p[1] : p; ndx_str = fname = NULL; - len = strlen(p); + len = (int) strlen(p); for (i = 0; i < len; i++) { if (p[i] == ':') { p[i] = '\0'; @@ -1279,22 +1277,22 @@ static int generate_cso_report(HTStream *Target) if (prev_ndx != ndx) { if (prev_ndx != -100) { HTSprintf0(&buf, "</DL></DL>\n"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } if (ndx == 0) { HTSprintf0(&buf, "<HR><DL><DT>Information/status<DD><DL><DT>\n"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } else { HTSprintf0(&buf, "<HR><DL><DT>Entry %d:<DD><DL COMPACT><DT>\n", ndx); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } prev_ndx = ndx; } } else { HTSprintf0(&buf, "<DD>%s\n", rcode); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); continue; } if ((*rcode >= '2') && (*rcode <= '5') && (fname != ndx_str)) { @@ -1304,7 +1302,7 @@ static int generate_cso_report(HTStream *Target) for (fvalue = fname; *fvalue; fvalue++) { if (*fvalue == ':') { *fvalue++ = '\0'; - i = strlen(fname) - 1; + i = (int) strlen(fname) - 1; while (i >= 0 && fname[i] == ' ') { fname[i--] = '\0'; /* trim trailing */ } @@ -1329,10 +1327,10 @@ static int generate_cso_report(HTStream *Target) HTSprintf0(&buf, "<DT><I>%s</I><DD><A HREF=\"%s\">%s</A>\n", fname, fvalue, fvalue); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } else { HTSprintf0(&buf, "<DT><I>%s</I><DD>", fname); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); buf[0] = '\0'; l = fvalue; while (*l) { @@ -1373,11 +1371,11 @@ static int generate_cso_report(HTStream *Target) } } StrAllocCat(buf, "\n"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } } else { HTSprintf0(&buf, "<DD>"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); buf[0] = '\0'; l = fvalue; while (*l) { @@ -1417,18 +1415,18 @@ static int generate_cso_report(HTStream *Target) } } StrAllocCat(buf, "\n"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } } else { HTSprintf0(&buf, "<DD>%s\n", fname ? fname : rcode); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } } } end_CSOreport: if (prev_ndx != -100) { HTSprintf0(&buf, "</DL></DL>\n"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); } FREE(buf); return 0; @@ -1619,6 +1617,7 @@ static int HTLoadCSO(const char *arg, "Warning: non-lookup field ignored<BR>\n"); (*Target->isa->put_block) (Target, buf, + (int) strlen(buf)); } } else if (data[start] == 'r') { @@ -1644,9 +1643,9 @@ static int HTLoadCSO(const char *arg, NETCLOSE(s); strcpy(buf, "<EM>Error:</EM> At least one indexed field value must be specified!\n"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); strcpy(buf, "</BODY>\n</HTML>\n"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); (*Target->isa->_free) (Target); free_CSOfields(); return HT_LOADED; @@ -1666,10 +1665,10 @@ static int HTLoadCSO(const char *arg, } HTBprintf(&command, "%c%c", CR, LF); strcpy(buf, "<H2>\n<EM>CSO/PH command:</EM> "); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); (*Target->isa->put_block) (Target, BStrData(command), BStrLen(command)); strcpy(buf, "</H2>\n"); - (*Target->isa->put_block) (Target, buf, strlen(buf)); + (*Target->isa->put_block) (Target, buf, (int) strlen(buf)); if (TRACE) { CTRACE((tfp, "HTLoadCSO: Writing command `")); trace_bstring(command); @@ -1722,7 +1721,7 @@ static int HTLoadGopher(const char *arg, * the ISINDEX search). - FM */ { - int len; + size_t len; if ((len = strlen(arg)) > 5) { if (0 == strcmp((const char *) &arg[len - 6], ":105/2")) { |