X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=blobdiff_plain;f=main.c;h=5403b70d64325655361ca2cd9e50223d8f94484c;hp=428d5bcb04b15d3d53d7f394f5eb3b0906d74124;hb=4c3459d73a3e6a145230490af14dbba647fe4896;hpb=42f0af690415fc59317203a187501c00c012c9d9 diff --git a/main.c b/main.c index 428d5bc..5403b70 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;