X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Famindex.c;h=7c52bd380564043709666ffa4f51a23dbc93f03c;hb=abdd6c0ba33ebe135aded60e79c7d5baa9ea7bd1;hp=d703618732480fe33103e6fcbf38eae64a418f9a;hpb=d3b2175e084f88c8736ad7073eacbf4670147aec;p=debian%2Famanda diff --git a/server-src/amindex.c b/server-src/amindex.c index d703618..7c52bd3 100644 --- a/server-src/amindex.c +++ b/server-src/amindex.c @@ -64,7 +64,7 @@ getindexfname( datebuf[SIZEOF(datebuf)-1] = '\0'; dc = datebuf; - snprintf(level_str, SIZEOF(level_str), "%d", level); + g_snprintf(level_str, SIZEOF(level_str), "%d", level); } host = sanitise_filename(host); @@ -72,12 +72,7 @@ getindexfname( disk = sanitise_filename(disk); } - conf_indexdir = getconf_str(CNF_INDEXDIR); - if (*conf_indexdir == '/') { - conf_indexdir = stralloc(conf_indexdir); - } else { - conf_indexdir = stralloc2(config_dir, conf_indexdir); - } + conf_indexdir = config_dir_relative(getconf_str(CNF_INDEXDIR)); /* * Note: vstralloc() will stop at the first NULL, which might be * "disk" or "dc" (datebuf) rather than the full file name. @@ -126,7 +121,7 @@ getoldindexfname( datebuf[SIZEOF(datebuf)-1] = '\0'; dc = datebuf; - snprintf(level_str, SIZEOF(level_str), "%d", level); + g_snprintf(level_str, SIZEOF(level_str), "%d", level); } host = old_sanitise_filename(host); @@ -134,12 +129,7 @@ getoldindexfname( disk = old_sanitise_filename(disk); } - conf_indexdir = getconf_str(CNF_INDEXDIR); - if (*conf_indexdir == '/') { - conf_indexdir = stralloc(conf_indexdir); - } else { - conf_indexdir = stralloc2(config_dir, conf_indexdir); - } + conf_indexdir = config_dir_relative(getconf_str(CNF_INDEXDIR)); /* * Note: vstralloc() will stop at the first NULL, which might be * "disk" or "dc" (datebuf) rather than the full file name.