projects
/
chise
/
xemacs-chise.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(U+6BB3): Apply new conventions for glyph granularity.
[chise/xemacs-chise.git-]
/
src
/
editfns.c
diff --git
a/src/editfns.c
b/src/editfns.c
index
ca314b9
..
8ad18f5
100644
(file)
--- a/
src/editfns.c
+++ b/
src/editfns.c
@@
-644,14
+644,17
@@
On Unix it is obtained from TMPDIR, with /tmp as the default.
}
else
{
}
else
{
- strcpy(path, getenv("HOME")); strncat(path, "/tmp/", _POSIX_PATH_MAX);
+ path[5 + _POSIX_PATH_MAX] = '\0';
+ strncpy(path, getenv("HOME"), 5 + _POSIX_PATH_MAX);
+ strncat(path, "/tmp/", 5 + _POSIX_PATH_MAX);
if (stat(path, &st) < 0 && errno == ENOENT)
{
int fd;
if (stat(path, &st) < 0 && errno == ENOENT)
{
int fd;
- char warnpath[1+_POSIX_PATH_MAX];
+ char warnpath[6+_POSIX_PATH_MAX];
mkdir(path, 0700); /* ignore retvals */
mkdir(path, 0700); /* ignore retvals */
- strcpy(warnpath, path);
- strncat(warnpath, ".created_by_xemacs", _POSIX_PATH_MAX);
+ warnpath[_POSIX_PATH_MAX] = '\0';
+ strncpy(warnpath, path, 5 + _POSIX_PATH_MAX);
+ strncat(warnpath, ".created_by_xemacs", 5 + _POSIX_PATH_MAX);
if ((fd = open(warnpath, O_WRONLY|O_CREAT, 0644)) > 0)
{
write(fd, "XEmacs created this directory because /tmp/<yourname> was unavailable -- \nPlease check !\n", 89);
if ((fd = open(warnpath, O_WRONLY|O_CREAT, 0644)) > 0)
{
write(fd, "XEmacs created this directory because /tmp/<yourname> was unavailable -- \nPlease check !\n", 89);