* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
+#include <string.h>
+#include <stdlib.h>
+
#include "gmqcc.h"
+
unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
opts_cmd_t opts; /* command lien options */
-static void opts_setdefault() {
+static void opts_setdefault(void) {
memset(&opts, 0, sizeof(opts_cmd_t));
OPTS_OPTION_BOOL(OPTION_CORRECTION) = true;
*/
static char *opts_ini_rstrip(char *s) {
char *p = s + strlen(s);
- while(p > s && isspace(*--p))
+ while(p > s && util_isspace(*--p))
*p = '\0';
return s;
}
static char *opts_ini_lskip(const char *s) {
- while (*s && isspace(*s))
+ while (*s && util_isspace(*s))
s++;
return (char*)s;
}
static char *opts_ini_next(const char *s, char c) {
bool last = false;
while (*s && *s != c && !(last && *s == ';'))
- last = !!isspace(*s), s++;
+ last = !!util_isspace(*s), s++;
return (char*)s;
}
/* section found */
if (*(parse_end = opts_ini_next(parse_beg + 1, ']')) == ']') {
* parse_end = '\0'; /* terminate bro */
- strncpy(section_data, parse_beg + 1, sizeof(section_data));
+ util_strncpy(section_data, parse_beg + 1, sizeof(section_data));
section_data[sizeof(section_data) - 1] = '\0';
*oldname_data = '\0';
} else if (!error) {
opts_ini_rstrip(read_value);
/* valid name value pair, lets call down to handler */
- strncpy(oldname_data, read_name, sizeof(oldname_data));
+ util_strncpy(oldname_data, read_name, sizeof(oldname_data));
oldname_data[sizeof(oldname_data) - 1] ='\0';
if ((*errorhandle = loadhandle(section_data, read_name, read_value)) && !error)
if ((line = opts_ini_parse(ini, &opts_ini_load, &error)) != 0) {
/* there was a parse error with the ini file */
- con_printmsg(LVL_ERROR, file, line, "error", error);
+ con_printmsg(LVL_ERROR, file, line, 0 /*TODO: column for ini error*/, "error", error);
vec_free(error);
}