X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/085cedfc6d4bf43c6feac2150cad47aea37b106f..d2a07ad8fcc5d1afe2faeda4744e66735deedd71:/sbr/fmt_compile.c diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 9ef39467..23e07263 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -270,7 +270,7 @@ static struct ftable functable[] = { #define PUTC(c) do { NEW(FT_CHAR,0,0); fp->f_char = (c); } while (0) static char *format_string; -static unsigned char *usr_fstring; /* for CERROR */ +static char *usr_fstring; /* for CERROR */ #define CERROR(str) compile_error (str, cp) @@ -321,7 +321,7 @@ compile_error(char *str, char *cp) for (i = errpos-errctx; i < errpos; i++) { #ifdef LOCALE - if (iscntrl(usr_fstring[i])) + if (iscntrl((unsigned char) usr_fstring[i])) #else if (usr_fstring[i] < 32) #endif @@ -873,7 +873,7 @@ fmt_freecomptext(void) cm->c_text = NULL; } } - + /* * Find a component in our hash table. This is just a public interface to * the FINDCOMP macro, so we don't have to expose our hash table. @@ -899,7 +899,7 @@ fmt_findcasecomp(char *component) struct comp *cm; for (cm = wantcomp[CHASH(component)]; cm; cm = cm->c_next) - if (mh_strcasecmp(component, cm->c_name) == 0) + if (strcasecmp(component, cm->c_name ? cm->c_name : "") == 0) break; return cm; @@ -951,18 +951,18 @@ fmt_addcomptext(char *component, char *text) char *cp; while (cptr) { - if (mh_strcasecmp(component, cptr->c_name) == 0) { + if (strcasecmp(component, cptr->c_name ? cptr->c_name : "") == 0) { found++; if (! cptr->c_text) { - cptr->c_text = getcpy(text); + cptr->c_text = getcpy(text); } else { - i = strlen(cp = cptr->c_text) - 1; + i = strlen(cp = cptr->c_text) - 1; if (cp[i] == '\n') { if (cptr->c_type & CT_ADDR) { - cp[i] = '\0'; + cp[i] = '\0'; cp = add(",\n\t", cp); } else { - cp = add("\t", cp); + cp = add("\t", cp); } } cptr->c_text = add(text, cp); @@ -986,7 +986,7 @@ fmt_appendcomp(int bucket, char *component, char *text) if (bucket != -1) { for (cptr = wantcomp[bucket]; cptr; cptr = cptr->c_next) - if (mh_strcasecmp(component, cptr->c_name) == 0) + if (strcasecmp(component, cptr->c_name ? cptr->c_name : "") == 0) cptr->c_text = add(text, cptr->c_text); } }