diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2021-01-02 00:20:37 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2021-01-02 00:20:37 +0000 |
commit | 1d0ba25a660483da1272a31dd077ed94441e3d9f (patch) | |
tree | 1d8dee52cd1e3d340fe178a8193dc96c4496db84 /w3mbookmark.c | |
parent | Merge branch 'cvstrunk' into upstream (diff) | |
download | w3m-upstream/0.5.3+git20210102.tar.gz w3m-upstream/0.5.3+git20210102.zip |
New upstream version 0.5.3+git20210102upstream/0.5.3+git20210102upstream
Diffstat (limited to '')
-rw-r--r-- | w3mbookmark.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/w3mbookmark.c b/w3mbookmark.c index 4355536..a306f26 100644 --- a/w3mbookmark.c +++ b/w3mbookmark.c @@ -79,6 +79,7 @@ print_bookmark_panel(char *bmark, char *url, char *title, char *charset) } } printf("</select>\n"); + fclose(f); } printf(bkmark_src2, html_quote(url), html_quote(title)); } @@ -99,7 +100,7 @@ create_new_bookmark(char *bmark, char *section, char *title, char *url, fprintf(f, "<body>\n<h1>Bookmarks</h1>\n"); fprintf(f, "<h2>%s</h2>\n<ul>\n", section); fprintf(f, "<li><a href=\"%s\">%s</a>\n", url, title); - fprintf(f, end_section); + fprintf(f, "%s", end_section); fprintf(f, "</ul>\n</body>\n</html>\n"); fclose(f); } @@ -168,7 +169,10 @@ insert_bookmark(char *bmark, struct parsed_tagarg *data) /* In this case, a new bookmark is appeneded after the bookmark file */ return create_new_bookmark(bmark, section, title, url, "a"); } - f = fopen(bmark, "w"); + if ((f = fopen(bmark, "w")) == NULL) { + printf("\nCannot open bookmark %s\n", bmark); + return FALSE; + } while (tl->nitem) { fputs(popText(tl), f); } |