comparison m_option.c @ 10355:b39a943c902f

Fix the segfault in case of missing arg for flag options in config files.
author albeu
date Tue, 01 Jul 2003 09:26:49 +0000
parents 4640f25fef12
children 6180d7558f75
comparison
equal deleted inserted replaced
10354:18ad3cda99d4 10355:b39a943c902f
73 73
74 #define VAL(x) (*(int*)(x)) 74 #define VAL(x) (*(int*)(x))
75 75
76 static int parse_flag(m_option_t* opt,char *name, char *param, void* dst, int src) { 76 static int parse_flag(m_option_t* opt,char *name, char *param, void* dst, int src) {
77 if (src == M_CONFIG_FILE) { 77 if (src == M_CONFIG_FILE) {
78 if(!param) return M_OPT_MISSING_PARAM;
78 if (!strcasecmp(param, "yes") || /* any other language? */ 79 if (!strcasecmp(param, "yes") || /* any other language? */
79 !strcasecmp(param, "on") || 80 !strcasecmp(param, "on") ||
80 !strcasecmp(param, "ja") || 81 !strcasecmp(param, "ja") ||
81 !strcasecmp(param, "si") || 82 !strcasecmp(param, "si") ||
82 !strcasecmp(param, "igen") || 83 !strcasecmp(param, "igen") ||