Avoid casting away low-level const.
char type_major[128] = "";
char type_minor[128] = "";
char *contp;
- const char *type = NULL;
+ char *type = NULL;
char *sep;
if((1 == sscanf(input, "%255[^=]=", name)) &&
}
/* now point beyond the content-type specifier */
- sep = (char *)type + strlen(type_major)+strlen(type_minor)+1;
+ sep = type + strlen(type_major)+strlen(type_minor)+1;
/* there's a semicolon following - we check if it is a filename
specified and if not we simply assume that it is text that
cleanarg(nextarg);
}
-ParameterError getparameter(char *flag, /* f or -long-flag */
- char *nextarg, /* NULL if unset */
- bool *usedarg, /* set to TRUE if the arg
- has been used */
+ParameterError getparameter(const char *flag, /* f or -long-flag */
+ char *nextarg, /* NULL if unset */
+ bool *usedarg, /* set to TRUE if the arg
+ has been used */
struct GlobalConfig *global,
struct OperationConfig *config)
{
if(('-' != flag[0]) ||
(('-' == flag[0]) && ('-' == flag[1]))) {
/* this should be a long name */
- char *word = ('-' == flag[0]) ? flag+2 : flag;
+ const char *word = ('-' == flag[0]) ? flag+2 : flag;
size_t fnam = strlen(word);
int numhits = 0;
struct GlobalConfig;
struct OperationConfig;
-ParameterError getparameter(char *flag, char *nextarg, bool *usedarg,
+ParameterError getparameter(const char *flag, char *nextarg, bool *usedarg,
struct GlobalConfig *global,
struct OperationConfig *operation);