aboutsummaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/basic')
-rw-r--r--scripts/basic/docproc.c22
-rw-r--r--scripts/basic/fixdep.c4
2 files changed, 14 insertions, 12 deletions
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
index dc7a0fcd2..ef5181226 100644
--- a/scripts/basic/docproc.c
+++ b/scripts/basic/docproc.c
@@ -79,7 +79,9 @@ void exec_kernel_doc(char **svec)
{
pid_t pid;
int ret;
- char real_filename[PATH_MAX + 1];
+ char *real_filename;
+ int rflen;
+
/* Make sure output generated so far are flushed */
fflush(stdout);
switch(pid=fork()) {
@@ -87,10 +89,11 @@ void exec_kernel_doc(char **svec)
perror("fork");
exit(1);
case 0:
- memset(real_filename, 0, sizeof(real_filename));
- strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
- strncat(real_filename, KERNELDOCPATH KERNELDOC,
- PATH_MAX - strlen(real_filename));
+ rflen = strlen(getenv("SRCTREE"));
+ rflen += strlen(KERNELDOCPATH KERNELDOC);
+ real_filename = alloca(rflen + 1);
+ strcpy(real_filename, getenv("SRCTREE"));
+ strcat(real_filename, KERNELDOCPATH KERNELDOC);
execvp(real_filename, svec);
fprintf(stderr, "exec ");
perror(real_filename);
@@ -166,11 +169,10 @@ void find_export_symbols(char * filename)
struct symfile *sym;
char line[MAXLINESZ];
if (filename_exist(filename) == NULL) {
- char real_filename[PATH_MAX + 1];
- memset(real_filename, 0, sizeof(real_filename));
- strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
- strncat(real_filename, filename,
- PATH_MAX - strlen(real_filename));
+ int rflen = strlen(getenv("SRCTREE")) + strlen(filename);
+ char *real_filename = alloca(rflen + 1);
+ strcpy(real_filename, getenv("SRCTREE"));
+ strcat(real_filename, filename);
sym = add_new_file(filename);
fp = fopen(real_filename, "r");
if (fp == NULL)
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 6d61044c4..bbb575cec 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -203,7 +203,7 @@ void clear_config(void)
*/
void use_config(char *m, int slen)
{
- char s[PATH_MAX];
+ char *s = alloca(slen+1);
char *p;
if (is_defined_config(m, slen))
@@ -310,7 +310,7 @@ void parse_dep_file(void *map, size_t len)
char *m = map;
char *end = m + len;
char *p;
- char s[PATH_MAX];
+ char *s = alloca(len);
p = memchr(m, ':', len);
if (!p) {