@@ 126,7 126,7 @@ int write_note(const char *head, const char *foot, const char *dir,
char tag_path[TAG_STR_SIZE];
memset(out_path, 0, STR_SIZE);
memset(tag_path, 0, TAG_STR_SIZE);
- sprintf(out_path, "%s%s", dir, note->path);
+ sprintf(out_path, "%s/%s", dir, note->path);
FILE *f = fopen(out_path, "w");
if (!f) {
fprintf(stderr, "could not open file '%s'.", out_path);
@@ 177,7 177,7 @@ int write_index_tag(const char *head, const char *foot, const char *dir,
bool public) {
char out_path[STR_SIZE];
memset(out_path, 0, STR_SIZE);
- sprintf(out_path, "%stags/%s.html", dir, tag);
+ sprintf(out_path, "%s/tags/%s.html", dir, tag);
strreplace(out_path, ' ', '-');
FILE *f = fopen(out_path, "w");
if (!f) {
@@ 232,7 232,7 @@ int write_indexes(const char *head, const char *foot, const char *dir,
char tag_path[TAG_STR_SIZE];
memset(out_path, 0, STR_SIZE);
memset(tag_path, 0, TAG_STR_SIZE);
- sprintf(out_path, "%sindex.html", dir);
+ sprintf(out_path, "%s/index.html", dir);
FILE *f = fopen(out_path, "w");
if (!f) {
fprintf(stderr, "could not open file '%s'.\n", out_path);
@@ 387,7 387,7 @@ int main(int argc, const char **argv) {
if (write_note(head_buffer, foot_buffer, lonely_directory, note_contents,
size, note)) {
- fprintf(stderr, "error writing note file '%s%s'.\n", lonely_directory,
+ fprintf(stderr, "error writing note file '%s/%s'.\n", lonely_directory,
note->path);
exitcode = 3;
goto exit;
@@ 399,7 399,7 @@ int main(int argc, const char **argv) {
if (write_note(head_buffer, foot_buffer, public_directory, note_contents,
size, note)) {
- fprintf(stderr, "error writing public note file '%s%s'.\n",
+ fprintf(stderr, "error writing public note file '%s/%s'.\n",
public_directory, note->path);
exitcode = 3;
goto exit;