struct swb_context ctx;
-static void set_config_defaults(struct swb_context * ctx) {
+static void set_config_defaults(struct swb_context *ctx) {
if (!ctx)
return;
free(ctx->other_browser_cmd);
len = strlen(homedir) + strlen(CONFIGFILE_LOC) + 1;
if (!(configfile = calloc(len, sizeof(char))))
goto out_noopen;
- strncpy(configfile, homedir, strlen(homedir));
- strncat(configfile, CONFIGFILE_LOC, strlen(CONFIGFILE_LOC));
+ snprintf(configfile, len, "%s%s", homedir, CONFIGFILE_LOC);
if (!(fp = fopen(configfile, "r")))
goto out_noopen;
/* Read in the config file one line at a time and parse it
XXX doesn't deal with lines longer than MAXLINE */
while (fgets(buf, MAXLINE, fp)) {
- printf("%s", buf);
/* skip blank lines and comments */
if (!regexec(&re_ignore, buf, 0, NULL, 0))
continue;
}
int main() {
- OssoBrowser * obj;
- GMainLoop * mainloop;
- GError * error = NULL;
+ OssoBrowser *obj;
+ GMainLoop *mainloop;
+ GError *error = NULL;
read_config(0);