aboutsummaryrefslogtreecommitdiffstats
path: root/local.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2015-08-11 13:05:46 +0000
committerTatsuya Kinoshita <tats@debian.org>2015-08-11 13:05:46 +0000
commitaf52480aabcb700c9bf68989a5e6c648d22f9945 (patch)
tree17ee2ecab281cfb16d0a622d7adf6ae4ce385cfa /local.c
parentUpdate ChangeLog (diff)
parentCheck for presence of prevl before using (diff)
downloadw3m-af52480aabcb700c9bf68989a5e6c648d22f9945.tar.gz
w3m-af52480aabcb700c9bf68989a5e6c648d22f9945.zip
Merge branch 'bug/sw3m'
Diffstat (limited to 'local.c')
-rw-r--r--local.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/local.c b/local.c
index 2728627..202e9c4 100644
--- a/local.c
+++ b/local.c
@@ -168,7 +168,7 @@ loadLocalDir(char *dname)
else {
#if defined(HAVE_LSTAT) && defined(HAVE_READLINK)
if (S_ISLNK(lst.st_mode)) {
- if ((l = readlink(fbuf->ptr, lbuf, sizeof(lbuf))) > 0) {
+ if ((l = readlink(fbuf->ptr, lbuf, sizeof(lbuf) - 1)) > 0) {
lbuf[l] = '\0';
Strcat_m_charp(tmp, " -> ",
html_quote(conv_from_system(lbuf)), NULL);
@@ -433,6 +433,5 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
fprintf(stderr, "execl(\"%s\", \"%s\", NULL): %s\n",
file, cgi_basename, strerror(errno));
exit(1);
- return NULL;
#endif
}