X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=blobdiff_plain;f=main.c;h=e84c2be7fbe8eadf94c6c07e369dcda1c520998a;hp=428d5bcb04b15d3d53d7f394f5eb3b0906d74124;hb=b457229dd6ff2f6bdcfed158937df2c54862f41e;hpb=42f0af690415fc59317203a187501c00c012c9d9 diff --git a/main.c b/main.c index 428d5bc..e84c2be 100644 --- a/main.c +++ b/main.c @@ -71,8 +71,7 @@ static void read_config(int signalnum) { 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; @@ -101,7 +100,6 @@ static void read_config(int signalnum) { /* 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;