projects
/
sxemacs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd91047
)
xstrncpy saga
author
Nelson Ferreira
<nelson.ferreira@ieee.org>
Fri, 2 Mar 2012 22:56:47 +0000
(17:56 -0500)
committer
Nelson Ferreira
<nelson.ferreira@ieee.org>
Fri, 2 Mar 2012 22:56:47 +0000
(17:56 -0500)
* src/dumper.c (pdump_load): Use xstrncpy instead of strncpy
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/dumper.c
patch
|
blob
|
history
diff --git
a/src/dumper.c
b/src/dumper.c
index
1b782a9
..
af22e0c
100644
(file)
--- a/
src/dumper.c
+++ b/
src/dumper.c
@@
-1375,7
+1375,7
@@
int pdump_load(const char *argv0)
/* invocation-name includes a directory component -- presumably it
is relative to cwd, not $PATH */
assert(strlen(dir) < sizeof(exe_path));
-
strncpy(exe_path, dir, sizeof(exe_path)-1
);
+
xstrncpy(exe_path, dir, sizeof(exe_path)
);
exe_path[sizeof(exe_path)-1]='\0';
} else {
const char *path = getenv("PATH");
@@
-1407,7
+1407,7
@@
int pdump_load(const char *argv0)
remain--;
}
if (remain > 0) {
- strncpy(w, name, remain);
+
x
strncpy(w, name, remain);
w[remain]='\0';
}